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

Issue 1821923003: Extract WebFrameClient implementation out of WebTestProxyBase. (Closed)

Created:
4 years, 9 months ago by Łukasz Anforowicz
Modified:
4 years, 8 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, jochen+watch_chromium.org, mkwst+moarreviews-shell_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-test-runner_chromium.org, Peter Beverloo, 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

Extract WebFrameClient implementation out of WebTestProxyBase. Overview ======== This CL extracts WebFrameClient-specific parts of WebTestProxyBase into a new WebFrameTestClient class. This CL is part of a sequence of CLs that make progress toward: 1) Splitting WebTestProxyBase into separate WebFrameClient / WebWidgetClient / WebViewClient focused classes 2) Removing WebTestProxyBase from public API of components/test_runner (and having WebTestProxy and WebFrameTestProxy consume instead abstract WebFrameClient / WebWidgetClient / WebViewClient interfaces). Details ======= Most of the change is mechanical move of code from WebTestProxyBase into the new WebFrameTestClient (slightly tweaking method signatures as needed to make them fit WebFrameClient interface - note camelCasing and extra parameters here and there). Additionally some helper methods (i.e. URLDescription and WebNavigationPolicyToString) are now needed by both WebTestProxyBase and by WebFrameTestClient. Consequently, to facilitate code reuse, these helper methods were moved to test_common.cc. Finally, in order to decouple WebFrameTestClient from view-specific WebTestProxyBase the CL does the following: - It moves counting currently active color choosers from WebTestProxyBase into TestRunner (and adjusts MockColorChooser accordingly). - It moves ownership of MockWebUserMediaClient from WebTestProxyBase into TestRunner. This is quite natural, as MockWebUserMediaClient depends only on WebTestDelegate::PostTask and WebTestDelegate::AddMediaStreamAudioSourceAndTrack (which are not view-specific). - Replacing WebFrameTestProxy::set_base_proxy with WebFrameTestProxy::set_test_client requires refactoring how higher layers provide the necessary object - in particular after the CL the WebFrame[Test]Client cannot be extracted from WebTestProxy/RenderView (because the whole point of this CL is to remove the coupling between view-specific WebTestProxy and frame-focused WebFrameTestProxy). This part of the refactoring is accomplished by adding a frame-proxy creation callback that can be provided to EnableWebTestProxyCreation (similarily how it already was accepting equivalent view-proxy creation callback). This refactoring also necessitates extracting a WebFrameTestProxyBase (to have a concrete/non-templatized type that content/shell/.../layout_tests layer can take a dependency on). BUG=595089 Committed: https://crrev.com/11e459b088ab4736f10776a3831d0b9ddf249517 Cr-Commit-Position: refs/heads/master@{#384044}

Patch Set 1 #

Patch Set 2 : Rebasing... #

Patch Set 3 : Remove unnecessary fwd declaration + comment tweak. #

Patch Set 4 : Removing unnecessary TEST_RUNNER_EXPORT. #

Patch Set 5 : Rebasing... #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1149 lines, -1046 lines) Patch
M components/test_runner/BUILD.gn View 1 1 chunk +2 lines, -0 lines 0 comments Download
M components/test_runner/mock_color_chooser.h View 1 1 chunk +21 lines, -17 lines 0 comments Download
M components/test_runner/mock_color_chooser.cc View 1 2 chunks +9 lines, -6 lines 1 comment Download
M components/test_runner/test_common.h View 2 chunks +7 lines, -0 lines 0 comments Download
M components/test_runner/test_common.cc View 3 chunks +38 lines, -0 lines 0 comments Download
M components/test_runner/test_runner.h View 1 4 chunks +11 lines, -1 line 0 comments Download
M components/test_runner/test_runner.cc View 1 6 chunks +18 lines, -1 line 0 comments Download
M components/test_runner/test_runner.gyp View 1 1 chunk +2 lines, -0 lines 0 comments Download
A components/test_runner/web_frame_test_client.h View 1 2 3 4 1 chunk +129 lines, -0 lines 0 comments Download
A components/test_runner/web_frame_test_client.cc View 1 2 3 4 1 chunk +765 lines, -0 lines 0 comments Download
M components/test_runner/web_frame_test_proxy.h View 1 2 3 4 10 chunks +69 lines, -60 lines 0 comments Download
M components/test_runner/web_test_interfaces.h View 3 chunks +9 lines, -0 lines 0 comments Download
M components/test_runner/web_test_interfaces.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M components/test_runner/web_test_proxy.h View 1 10 chunks +0 lines, -122 lines 0 comments Download
M components/test_runner/web_test_proxy.cc View 1 16 chunks +4 lines, -779 lines 0 comments Download
M content/public/test/layouttest_support.h View 1 2 chunks +11 lines, -5 lines 0 comments Download
M content/shell/renderer/layout_test/layout_test_content_renderer_client.h View 2 chunks +0 lines, -18 lines 0 comments Download
M content/shell/renderer/layout_test/layout_test_content_renderer_client.cc View 3 chunks +28 lines, -18 lines 0 comments Download
M content/test/layouttest_support.cc View 1 2 chunks +14 lines, -19 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 15 (5 generated)
Łukasz Anforowicz
jochen@, can you please take a look?
4 years, 9 months ago (2016-03-24 22:48:55 UTC) #3
jochen (gone - plz use gerrit)
lgtm
4 years, 8 months ago (2016-03-30 16:23:52 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1821923003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1821923003/80001
4 years, 8 months ago (2016-03-30 18:03:58 UTC) #6
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 8 months ago (2016-03-30 19:08:07 UTC) #7
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/11e459b088ab4736f10776a3831d0b9ddf249517 Cr-Commit-Position: refs/heads/master@{#384044}
4 years, 8 months ago (2016-03-30 19:09:59 UTC) #9
kochi
Hi Łukasz, I bumped into a use-after-free today, probably caused by this change. Attached an ...
4 years, 8 months ago (2016-03-31 08:14:34 UTC) #11
kochi
> crash log for unknown process name (pid <unknown>): > STDOUT: PASS testRunner.isChooserShown() is false ...
4 years, 8 months ago (2016-03-31 08:18:13 UTC) #12
kochi
On 2016/03/31 08:18:13, kochi wrote: > > crash log for unknown process name (pid <unknown>): ...
4 years, 8 months ago (2016-03-31 08:42:08 UTC) #13
jochen (gone - plz use gerrit)
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/1841833005/ by jochen@chromium.org. ...
4 years, 8 months ago (2016-03-31 08:42:59 UTC) #14
chromium-reviews
4 years, 8 months ago (2016-03-31 14:21:03 UTC) #15
Message was sent while issue was closed.
Thanks for the heads-up and the revert attempt.  I'll revert the chain of 3
CLs that depend on each other (and prevented jochen@'s revert from applying
cleanly).

On Thu, Mar 31, 2016 at 1:42 AM, <jochen@chromium.org> wrote:

> A revert of this CL (patchset #5 id:80001) has been created in
> https://codereview.chromium.org/1841833005/ by jochen@chromium.org.
>
> The reason for reverting is: use after free in color chooser.
>
> https://codereview.chromium.org/1821923003/
>



-- 
Thanks,

Lukasz

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698