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

Issue 2225053002: Fix tests to behave properly with ISNs/DSNs. (Closed)

Created:
4 years, 4 months ago by nasko
Modified:
4 years, 3 months ago
Reviewers:
Charlie Reis
CC:
chromium-reviews, jam, nasko+codewatch_chromium.org, darin-cc_chromium.org, creis+watch_chromium.org, 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

Fix tests to behave properly with ISNs/DSNs. Currently, there are few tests that behave in a way that is not possible in regular browsing in full browser. This CL fixes them, so we can enable some invariant checks. BUG=628677 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/3f85512f193106599ee7f02831b5ef8bed6e0780 Cr-Commit-Position: refs/heads/master@{#410500}

Patch Set 1 #

Patch Set 2 : #

Total comments: 5

Patch Set 3 : Rename test helper method and add TODO. #

Total comments: 4

Patch Set 4 : Fix nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -11 lines) Patch
M content/browser/frame_host/navigation_controller_impl_browsertest.cc View 1 2 3 6 chunks +10 lines, -11 lines 0 comments Download
M content/test/test_render_frame_host.cc View 3 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (13 generated)
nasko
Hey Charlie, Can you review this CL for me? It fixes the browser tests to ...
4 years, 4 months ago (2016-08-08 18:10:07 UTC) #7
Charlie Reis
Sure. I take it the plan is to land this and then turn on the ...
4 years, 4 months ago (2016-08-08 21:27:11 UTC) #10
nasko
> I take it the plan is to land this and then turn on the ...
4 years, 4 months ago (2016-08-08 21:57:09 UTC) #11
Charlie Reis
Thanks-- LGTM with nits. https://codereview.chromium.org/2225053002/diff/20001/content/browser/frame_host/navigation_controller_impl_browsertest.cc File content/browser/frame_host/navigation_controller_impl_browsertest.cc (right): https://codereview.chromium.org/2225053002/diff/20001/content/browser/frame_host/navigation_controller_impl_browsertest.cc#newcode483 content/browser/frame_host/navigation_controller_impl_browsertest.cc:483: bool NavigateToURLAndReplace(Shell* shell, const GURL& ...
4 years, 4 months ago (2016-08-08 22:06:16 UTC) #12
nasko
https://codereview.chromium.org/2225053002/diff/40001/content/browser/frame_host/navigation_controller_impl_browsertest.cc File content/browser/frame_host/navigation_controller_impl_browsertest.cc (right): https://codereview.chromium.org/2225053002/diff/40001/content/browser/frame_host/navigation_controller_impl_browsertest.cc#newcode482 content/browser/frame_host/navigation_controller_impl_browsertest.cc:482: // Similar to the ones from content_browser_test_utils. On 2016/08/08 ...
4 years, 4 months ago (2016-08-08 22:39:48 UTC) #13
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/2225053002/60001
4 years, 4 months ago (2016-08-08 22:46:47 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/203753)
4 years, 4 months ago (2016-08-08 23:06:08 UTC) #18
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/2225053002/60001
4 years, 4 months ago (2016-08-08 23:14:19 UTC) #20
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 4 months ago (2016-08-08 23:42:10 UTC) #21
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/3f85512f193106599ee7f02831b5ef8bed6e0780 Cr-Commit-Position: refs/heads/master@{#410500}
4 years, 4 months ago (2016-08-08 23:45:35 UTC) #23
Alexander Semashko
Hi! I'm concerned about the PageIDUpdatedOnPageReplacement test, its whole point was in doing a cross-process ...
4 years, 3 months ago (2016-09-08 16:16:09 UTC) #24
nasko
On 2016/09/08 16:16:09, Alexander Semashko wrote: > Hi! Hey! > I'm concerned about the PageIDUpdatedOnPageReplacement ...
4 years, 3 months ago (2016-09-09 00:20:20 UTC) #25
Alexander Semashko
4 years, 3 months ago (2016-09-12 20:13:06 UTC) #26
Message was sent while issue was closed.
On 2016/09/09 00:20:20, nasko (slow) wrote:
> On 2016/09/08 16:16:09, Alexander Semashko wrote:
> > Hi!
> 
> Hey!
> 
> > I'm concerned about the PageIDUpdatedOnPageReplacement test, its whole point
> was
> > in doing a cross-process navigation.
> 
> Looking at the repro steps from https://crbug.com/611679#c2, the new way the
> test behaves similarly. It instructs the renderer process to issue a
> "location.replace()" call with the supplied URL. I have missed the bit about
> cross-process navigation. Why not update the test to an actual URL that will
> cause the cross-process navigation when it is renderer initiated?

Ok, I'll look closer to what happens in this test when calling location.replace
with changing a webui url to a non-webui url. It should reproduce the bug as
well.

> 
> > Can you please describe which invariants were violated before this patch?
> 
> The invariant was that browser initiated navigations don't have
> should_replace_current_entry set to true. Unfortunately, I can't find in my
> notes which exact CHECK I tried to add that caused issues with these tests.
> 
> > Currently, if I revert the test locally, it still passes.
> 
> Revert what test are you reverting? Or are you reverting the change I made to
> the test?
> 
> > Also, what exactly is, as CL description says, not possible in regular
> browsing
> > in full browser?
> 
> Browser initiated navigation with should_replace_current_entry set to true.

Just curious: what are the benefits of enforcing this invariant, noting that
calling LoadURLWithParams with is_renderer_initiated==true and
should_replace_current_entry==true is absolutely valid? It looks like just a
small option that is good to have in some cases, e.g. it might be useful for
extensions if there is an api, or for downstream projects. And such navigations
could occur in Android Chrome recently (at least, before a flag to initialize
renderer without first navigating the WebContents was implemented.

> 
> > One can easily open a webui page and type
location.replace('http://foo.bar/')
> in
> > devtools console; this will cause the navigation to go through
> > FrameHostMsg_OpenURL to chrome::Navigate and finally
> > NavigationController::LoadURLWithParams will be called with basically same
> > params. Am I missing something?
> 
> In that case the is_renderer_initiated member of LoadURLParams should be set
to
> true, shouldn't it?

Yeah, I was somewhat missing the fact the there is is_renderer_initiated flag.
When saying "browser-initiated navigation" I meant a navigation issued by
browser process (via FrameMsg_Navigate), because it seems that
is_renderer_initiated flag does not matter for this test and the related bug. It
only needs that a new renderer is created and navigated with
should_replace_current_entry==true.

Powered by Google App Engine
This is Rietveld 408576698