Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Issue 1890223002: Explicitly initialize secondary renderers for layout tests. (Closed)

Created:
4 years, 8 months ago by Łukasz Anforowicz
Modified:
4 years, 8 months ago
CC:
chromium-reviews, darin-cc_chromium.org, devtools-reviews_chromium.org, jam, jochen+watch_chromium.org, mkwst+moarreviews-shell_chromium.org, mlamouri+watch-test-runner_chromium.org, mlamouri+watch-content_chromium.org, Peter Beverloo, pfeldman, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Explicitly initialize secondary renderers for layout tests. Secondary renderers used to be implicitly initized for layout tests in BlinkTestRunner::Navigate method, relying on comparisons with LayoutTestRenderProcessObserver::GetInstance()->main_test_runner(). Such initialization is brittle: 1. it relies on correct singling out of a specific BlinkTestRunner and designating it as a main_test_runner (right now this is the instance that happens to be created first in the given renderer process) 2. it reinitializes the test after each navigation, which may clobber previous test state changes which is especially worrisome if another BlinkTestRunner is present in the same process (with OOPIFs a BlinkTestRunner for secondary and main test window can coexist in the same renderer process). This CL starts to explicitly initialize all secondary renderers via ShellViewMsg_SetupSecondaryRenderer message, tracking them on the browser-side in BrowserTestController::HandleNewRenderFrameHost. This helps avoid the brittleness described above. Additionally explicit initialization helps to guarantee that a secondary renderer is initialized before propagating to such renderer changes of LayoutTestRuntimeFlags (planned in https://crrev.com/1878863002). Cleaning up BlinkTestRunner::Navigate method (and fixing up the target BlinkTestRunner used by LayoytTestRenderFrameObserver) enables to remove one occurence of a global field holding (an essentially non-global) BlinkTestRunner - we can now remove LayoutTestRenderProcessObserver::main_test_runner_ field (and then also remove LayoutTestRenderProcessObserver::SetMainWindow which can be simply inlined into LayoutTestContentRendererClient). BUG=595089 Committed: https://crrev.com/8e550a0c01885ed449fd7ea4540f2d6f18762d16 Cr-Commit-Position: refs/heads/master@{#387963}

Patch Set 1 #

Patch Set 2 : Self-review. #

Total comments: 3

Patch Set 3 : Rebasing... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+153 lines, -156 lines) Patch
M content/content_shell.gypi View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M content/shell/BUILD.gn View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M content/shell/browser/layout_test/blink_test_controller.h View 4 chunks +8 lines, -2 lines 0 comments Download
M content/shell/browser/layout_test/blink_test_controller.cc View 4 chunks +45 lines, -27 lines 0 comments Download
M content/shell/browser/layout_test/layout_test_devtools_frontend.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/shell/browser/layout_test/layout_test_devtools_frontend.cc View 1 chunk +11 lines, -0 lines 0 comments Download
D content/shell/browser/layout_test/notify_done_forwarder.h View 1 chunk +0 lines, -34 lines 0 comments Download
D content/shell/browser/layout_test/notify_done_forwarder.cc View 1 chunk +0 lines, -33 lines 0 comments Download
A + content/shell/browser/layout_test/secondary_test_window_observer.h View 1 2 chunks +14 lines, -10 lines 0 comments Download
A + content/shell/browser/layout_test/secondary_test_window_observer.cc View 1 2 chunks +25 lines, -8 lines 0 comments Download
M content/shell/browser/shell.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/shell/common/shell_messages.h View 1 chunk +8 lines, -2 lines 0 comments Download
M content/shell/renderer/layout_test/blink_test_runner.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/renderer/layout_test/blink_test_runner.cc View 1 2 2 chunks +10 lines, -9 lines 0 comments Download
M content/shell/renderer/layout_test/layout_test_content_renderer_client.cc View 1 2 1 chunk +9 lines, -2 lines 0 comments Download
M content/shell/renderer/layout_test/layout_test_render_frame_observer.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/renderer/layout_test/layout_test_render_frame_observer.cc View 1 2 3 chunks +9 lines, -4 lines 0 comments Download
M content/shell/renderer/layout_test/layout_test_render_thread_observer.h View 1 2 3 chunks +0 lines, -6 lines 0 comments Download
M content/shell/renderer/layout_test/layout_test_render_thread_observer.cc View 1 2 3 chunks +1 line, -11 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 13 (6 generated)
Łukasz Anforowicz
jochen@, could you please take a look? https://codereview.chromium.org/1890223002/diff/20001/content/shell/browser/layout_test/blink_test_controller.h File content/shell/browser/layout_test/blink_test_controller.h (right): https://codereview.chromium.org/1890223002/diff/20001/content/shell/browser/layout_test/blink_test_controller.h#newcode273 content/shell/browser/layout_test/blink_test_controller.h:273: std::set<RenderProcessHost*> all_observed_render_process_hosts_; ...
4 years, 8 months ago (2016-04-15 20:15:29 UTC) #2
jochen (gone - plz use gerrit)
lgtm
4 years, 8 months ago (2016-04-17 17:09:08 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890223002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890223002/20001
4 years, 8 months ago (2016-04-18 14:40:54 UTC) #5
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_gn on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_gn/builds/20632) ios_rel_device_gn on tryserver.chromium.mac (JOB_FAILED, ...
4 years, 8 months ago (2016-04-18 14:43:22 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890223002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890223002/40001
4 years, 8 months ago (2016-04-18 17:21:05 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 8 months ago (2016-04-18 18:34:26 UTC) #11
commit-bot: I haz the power
4 years, 8 months ago (2016-04-18 18:37:05 UTC) #13
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/8e550a0c01885ed449fd7ea4540f2d6f18762d16
Cr-Commit-Position: refs/heads/master@{#387963}

Powered by Google App Engine
This is Rietveld 408576698