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

Issue 2470413004: PlzNavigate: Fix for the PhishingDOMFeatureExtractorTest.SubFrames and SubframeRemoval tests (Closed)

Created:
4 years, 1 month ago by ananta
Modified:
4 years ago
Reviewers:
Nathan Parker, jam
CC:
chromium-reviews, grt+watch_chromium.org, darin-cc_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PlzNavigate: Fix for the PhishingDOMFeatureExtractorTest.SubFrames and SubframeRemoval tests The PhishingDOMFeatureExtractorTest tests instantiate the renderer side of the navigation code namely RenderFrameImpl, RenderView, etc. However the browser side of the navigation is not instantiated. The navigation code in RenderFrame checks for whether browser side navigation is enabled and sends IPCs etc which don't work for the tests as written. Proposed fix is to provide a way to mock the IPCs being sent in the codepaths being exercised in these tests. Specifically the FrameHostMsg_BeginNavigation and FrameMsg_CommitNavigation IPCs. To achieve this we provide a way to subclass the ChromeMockRenderThread class which is instantiated by the ChromeRenderViewTest class. This is achieved via a virtual function CreateMockRenderThread(). This function is overridden by a new class PhishingMockRenderThread which is instantiated for the duration of the PhishingDOMFeatureExtractorTest.* tests. The other alternative was to make these tests full fledged browser tests which would be a touch difficult given the way these tests have been written. BUG=662268 TBR=jam Committed: https://crrev.com/5fc8d8d462127a0f20651df4c8a8971926f21f50 Cr-Commit-Position: refs/heads/master@{#430811}

Patch Set 1 #

Patch Set 2 : Update DEPS #

Patch Set 3 : Revert some changes #

Patch Set 4 : Revert more changes #

Patch Set 5 : Fix build redness #

Total comments: 6

Patch Set 6 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -2 lines) Patch
M chrome/renderer/chrome_mock_render_thread.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/renderer/safe_browsing/DEPS View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc View 1 2 3 4 5 4 chunks +52 lines, -0 lines 0 comments Download
M chrome/test/base/chrome_render_view_test.h View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/test/base/chrome_render_view_test.cc View 1 2 chunks +5 lines, -1 line 0 comments Download

Messages

Total messages: 37 (22 generated)
ananta
4 years, 1 month ago (2016-11-04 02:56:33 UTC) #2
jam
It seems either we need to: 1) figure out a way to fake whatever navigation-related ...
4 years, 1 month ago (2016-11-04 16:18:52 UTC) #7
ananta
On 2016/11/04 16:18:52, jam (ooo until Dec 5) wrote: > It seems either we need ...
4 years, 1 month ago (2016-11-07 22:35:58 UTC) #9
ananta
4 years, 1 month ago (2016-11-07 22:37:40 UTC) #11
Nathan Parker
lgtm https://codereview.chromium.org/2470413004/diff/80001/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc File chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc (right): https://codereview.chromium.org/2470413004/diff/80001/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc#newcode217 chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc:217: message.reset(new FrameMsg_CommitNavigation( I'm not familiar with these IPCs ...
4 years, 1 month ago (2016-11-08 23:27:30 UTC) #20
ananta
https://codereview.chromium.org/2470413004/diff/80001/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc File chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc (right): https://codereview.chromium.org/2470413004/diff/80001/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc#newcode217 chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc:217: message.reset(new FrameMsg_CommitNavigation( On 2016/11/08 23:27:30, Nathan Parker wrote: > ...
4 years, 1 month ago (2016-11-08 23:52:05 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2470413004/100001
4 years, 1 month ago (2016-11-08 23:53:20 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/299980)
4 years, 1 month ago (2016-11-09 00:03:16 UTC) #26
ananta
TBR'ing jam
4 years, 1 month ago (2016-11-09 00:15:01 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2470413004/100001
4 years, 1 month ago (2016-11-09 00:15:43 UTC) #30
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 1 month ago (2016-11-09 01:42:19 UTC) #32
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/5fc8d8d462127a0f20651df4c8a8971926f21f50 Cr-Commit-Position: refs/heads/master@{#430811}
4 years, 1 month ago (2016-11-09 01:46:51 UTC) #34
jam
not lgtm, the deps line is not ok. let's discuss a way to fix this ...
4 years ago (2016-12-06 15:26:11 UTC) #35
ananta
On 2016/12/06 15:26:11, John Abd-El-Malek wrote: > not lgtm, the deps line is not ok. ...
4 years ago (2016-12-07 03:35:04 UTC) #36
jam
4 years ago (2016-12-09 23:14:50 UTC) #37
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:100001) has been created in
https://codereview.chromium.org/2565543006/ by jam@chromium.org.

The reason for reverting is: This isn't needed anymore after r437654.

Powered by Google App Engine
This is Rietveld 408576698