New issue
Advanced search Search tips

Issue 734748 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Refactor PageTestBase / DummyPageHolder tests to be based on top of WebViewHelper

Project Member Reported by dcheng@chromium.org, Jun 19 2017

Issue description

Now that we're merging web into core, the helpers from FrameTestHelpers and SimTests are both available in core directly. We should prefer testing using these when possible.

Maybe we can start with by renaming DummyPageHolder to indicate it's deprecated, and seeing what functionality people are missing when they write new tests.
 
Labels: TE-NeedsTriageHelp
Owner: ----

Comment 3 by dcheng@chromium.org, Apr 20 2018

Owner: dcheng@chromium.org
Status: Assigned (was: Unconfirmed)
Summary: Refactor PageTestBase / DummyPageHolder tests to be based on top of WebViewHelper (was: Deprecate tests based on DummyPageHolder)
Right now, we provide multiple injection points for tests: one at the former core<->web boundary, and another at the Blink public API boundary.

Tests should just use WebViewHelper. We can reimplement DummyPageHolder in terms of WebViewHelper; however, this will require fixing existing tests to not depend on hooking ChromeClient / LocalFrameClient.

This came up when looking at how accelerated compositing enabled is used today: a number of core tests disable it because they don't have a WebLayerTreeView.
Project Member

Comment 4 by bugdroid1@chromium.org, May 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7404fdd901e55bb97671392b41f13901bcbfd524

commit 7404fdd901e55bb97671392b41f13901bcbfd524
Author: Daniel Cheng <dcheng@chromium.org>
Date: Wed May 02 21:15:08 2018

Simplify DummyPageHolder-based tests that don't need custom clients

This is the first step in a multi step plan to simplify the number of
injection points core exposes for testing:
1. Simplify existing DummyPageHolder tests that don't need custom
   clients. These can be trivially migrated to the new DummyPageHolder
   and PageTestBase implemented in step 3.
2. Rename DummyPageHolder and PageTestBase to DummyPageHolderDeprecated
   and PageTestBaseDeprecated.
3. Implement new DummyPageHolder and PageTestBase based on
   WebViewHelper.
4. Migrate tests that don't need custom clients to the new
   DummyPageHolder or PageTestBase.
5. Migrate tests that need custom clients by migrating the hooks from
   ChromeClient / LocalFrameClient to WebViewClient, WebWidgetClient, or
   WebFrameClient as appropriate.
6. Remove DummyPageholderDeprecated and PageTestBaseDeprecated.

Bug: 734748
Change-Id: I37a4b60770b6d76933ff475253f7b15dcf8df26d
Reviewed-on: https://chromium-review.googlesource.com/1020814
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555537}
[modify] https://crrev.com/7404fdd901e55bb97671392b41f13901bcbfd524/third_party/blink/renderer/core/html/canvas/canvas_font_cache_test.cc
[modify] https://crrev.com/7404fdd901e55bb97671392b41f13901bcbfd524/third_party/blink/renderer/core/html/forms/html_form_control_element_test.cc
[modify] https://crrev.com/7404fdd901e55bb97671392b41f13901bcbfd524/third_party/blink/renderer/core/html/forms/html_select_element_test.cc
[modify] https://crrev.com/7404fdd901e55bb97671392b41f13901bcbfd524/third_party/blink/renderer/core/html/forms/password_input_type_test.cc
[modify] https://crrev.com/7404fdd901e55bb97671392b41f13901bcbfd524/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_api_test.cc
[modify] https://crrev.com/7404fdd901e55bb97671392b41f13901bcbfd524/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_test.cc
[modify] https://crrev.com/7404fdd901e55bb97671392b41f13901bcbfd524/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
[modify] https://crrev.com/7404fdd901e55bb97671392b41f13901bcbfd524/third_party/blink/renderer/modules/canvas/offscreencanvas/offscreen_canvas_test.cc

Project Member

Comment 5 by bugdroid1@chromium.org, May 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3bd782b461d57a14f9067412b0cde1eda20ac720

commit 3bd782b461d57a14f9067412b0cde1eda20ac720
Author: Daniel Cheng <dcheng@chromium.org>
Date: Fri May 04 18:47:24 2018

Unconditionally detach in Page::WillDetachFrame()

ElementVisibilityObserverTest was using PageTestBase and would
have been tricky to fix properly; instead just migrate it over
to use FrameTestHelpers::WebViewHelper.

PresentationAvailabilityTest is left as a V8TestingScope for
now but should ultimately be converted as well.

Bug: 700783, 734748
Change-Id: Ic73f187a2a1082891168143e37675a763f80db2c
Reviewed-on: https://chromium-review.googlesource.com/1038142
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556134}
[modify] https://crrev.com/3bd782b461d57a14f9067412b0cde1eda20ac720/third_party/blink/renderer/core/dom/element_visibility_observer_test.cc
[modify] https://crrev.com/3bd782b461d57a14f9067412b0cde1eda20ac720/third_party/blink/renderer/core/frame/local_frame.cc
[modify] https://crrev.com/3bd782b461d57a14f9067412b0cde1eda20ac720/third_party/blink/renderer/core/page/page.cc
[modify] https://crrev.com/3bd782b461d57a14f9067412b0cde1eda20ac720/third_party/blink/renderer/modules/presentation/presentation_availability_test.cc

Cc: loonyb...@chromium.org

Sign in to add a comment