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

Issue 2157153003: Call WillStartRequestForTesting in TestRenderFrameHost (Closed)

Created:
4 years, 5 months ago by Charlie Harrison
Modified:
4 years, 5 months ago
Reviewers:
clamy, oshima
CC:
chromium-reviews, darin-cc_chromium.org, jam, Bryan McQuade
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Call WillStartRequestForTesting in TestRenderFrameHost This CL calls WillStartRequest on the current NavigationHandle when a navigation is starting. This mimics the SimulateRedirect call, and enables NavigationThrottles which override WillStartRequest to be unit testable using the content unit test framework. Note: like SimulateRedirect, there is no current support for the throttles actually cancelling / deferring the navigation. BUG=627501 Committed: https://crrev.com/dd06babf17af821c4fce1d6509946188c43fd208 Cr-Commit-Position: refs/heads/master@{#407150}

Patch Set 1 #

Total comments: 1

Patch Set 2 : merge session / remove DCHECK #

Total comments: 2

Patch Set 3 : rebase on #406654 #

Patch Set 4 : Thread transition and docuemnt ShouldAttachNavigationThrottle #

Total comments: 1

Patch Set 5 : Just null check nav handle #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -1 line) Patch
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M content/test/test_render_frame_host.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M content/test/test_render_frame_host.cc View 1 2 3 4 4 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (27 generated)
Charlie Harrison
clamy@, WDYT about this? If you think this method looks okay, then it should greatly ...
4 years, 5 months ago (2016-07-18 21:36:36 UTC) #5
Charlie Harrison
Looks like the MergeSessionNavigationThrottle does NOT like being added in unit test code :) Would ...
4 years, 5 months ago (2016-07-18 22:25:41 UTC) #8
clamy
Thanks! That seems reasonable though I'm not an owner for the MergeSessionThrottle, so you should ...
4 years, 5 months ago (2016-07-19 14:10:54 UTC) #9
Charlie Harrison
clamy@ I couldn't quite get the resuming / deferring working so I punted on that. ...
4 years, 5 months ago (2016-07-19 22:33:41 UTC) #15
oshima
lgtm https://codereview.chromium.org/2157153003/diff/20001/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h File chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h (right): https://codereview.chromium.org/2157153003/diff/20001/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h#newcode28 chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h:28: bool ShouldAttachNavigationThrottle(); please document this
4 years, 5 months ago (2016-07-20 21:53:31 UTC) #20
Charlie Harrison
Thanks! clamy@, could you take another look? https://codereview.chromium.org/2157153003/diff/20001/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h File chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h (right): https://codereview.chromium.org/2157153003/diff/20001/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h#newcode28 chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h:28: bool ShouldAttachNavigationThrottle(); ...
4 years, 5 months ago (2016-07-21 14:15:22 UTC) #23
clamy
Thanks! One issue with one of the SimulateWillStart calls below. If it is fine with ...
4 years, 5 months ago (2016-07-21 16:17:30 UTC) #26
Charlie Harrison
Looks like you were right to be nervous about PlzNavigate. I'll continue poking at this.
4 years, 5 months ago (2016-07-21 19:18:48 UTC) #27
Charlie Harrison
Failing tests were calling SimulateWillStartRequest without a valid navigation_handle(). Changing the DCHECK to a early ...
4 years, 5 months ago (2016-07-22 00:04:17 UTC) #32
Charlie Harrison
side note: Do you have a plan for running this bot on the CQ?
4 years, 5 months ago (2016-07-22 00:05:11 UTC) #33
clamy
Thanks! Lgtm. We do run content_browsertests with PlzNavigate on CQ, but not the unit tests.
4 years, 5 months ago (2016-07-22 14:10:09 UTC) #34
Charlie Harrison
On 2016/07/22 14:10:09, clamy wrote: > Thanks! Lgtm. We do run content_browsertests with PlzNavigate on ...
4 years, 5 months ago (2016-07-22 14:11:18 UTC) #35
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/2157153003/80001
4 years, 5 months ago (2016-07-22 14:11:42 UTC) #38
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 5 months ago (2016-07-22 14:15:17 UTC) #40
commit-bot: I haz the power
4 years, 5 months ago (2016-07-22 14:16:32 UTC) #42
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/dd06babf17af821c4fce1d6509946188c43fd208
Cr-Commit-Position: refs/heads/master@{#407150}

Powered by Google App Engine
This is Rietveld 408576698