New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 1 user

Issue metadata

Status: Started
Owner:
ooo until Aug 28
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Replace usage of RenderFrameHostTester navigation methods by NavigationSimulators

Project Member Reported by clamy@chromium.org, Jun 1 2017

Issue description

The NavigationSimulator provides a better interface for simulating navigations in unit tests than the fine grained methods of RenderFrameHostTester (in particular it provides correct swapping of test RFHs). We should convert unit tests to use it in order to ensure that they keep testing a correct interleaving of navigation events.

To do that, we need the following:
1) Extend NavigationSimulator to cover browser-initiated navigations.
2) Remove usage of RenderFrameHostTester::SimulateNavigationStart/SimulateRedirect/SimulateNavigationCommit/SimulateNavigationError/SimulateNavigationErrorPageCommit/SimulateNavigationStop in unit_tests, and remove these methods from the content/public/test API.
3) Consider moving away from those methods in content_unittests that don't test navigation specifically.
 

Comment 1 by clamy@chromium.org, Jul 17 2017

Labels: -Pri-3 Pri-2
Owner: clamy@chromium.org
Status: Started (was: Untriaged)
I have started looking at this, as the way unit_tests are written is starting to be an impediment to several changes we want to make.
Cc: csharrison@chromium.org
This has come up with me too in a few different contexts already. Can we also try to deprecate or discourage the use of test NavigationHandles?

Comment 3 by clamy@chromium.org, Jul 17 2017

Ok, I'll keep it in mind. I'm focusing on removing usage of navigation methods from renderFrameHostTester and WebContentsTester first, as they are often wrongly used.
Cc: ahemery@chromium.org arthurso...@chromium.org
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1667a8fb7c2697a4e394338d029f0a311c85a00d

commit 1667a8fb7c2697a4e394338d029f0a311c85a00d
Author: arthursonzogni <arthursonzogni@chromium.org>
Date: Wed Jul 19 17:28:23 2017

NavigationSimulator: Initialize RenderFrame if needed.

In order to make the RenderFrameHost ready for simulating RenderFrame
originated IPCs, the RenderFrame needs to be initialized.

Bug: 728571
Change-Id: Ia80080a2e304dc2c37582599406b0cde3a22b027
Reviewed-on: https://chromium-review.googlesource.com/575237
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487901}
[modify] https://crrev.com/1667a8fb7c2697a4e394338d029f0a311c85a00d/content/public/test/navigation_simulator.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Jul 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ba40a39f5c212167bcfc2b5163d500b6d298aa82

commit ba40a39f5c212167bcfc2b5163d500b6d298aa82
Author: arthursonzogni <arthursonzogni@chromium.org>
Date: Thu Jul 20 18:04:53 2017

NavigationSimulator: Simulate item and document sequence number.

Simulate Blink assigning an item and document sequence number to the
navigation. This is similar to what is done in
TestRenderFrameHost::SendNavigateWithParameters().

Bug: 728571
Change-Id: I6915d7e80154779c87294d71a1a395b862fc428b
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_browser_side_navigation_rel
Reviewed-on: https://chromium-review.googlesource.com/579380
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488310}
[modify] https://crrev.com/ba40a39f5c212167bcfc2b5163d500b6d298aa82/content/public/test/navigation_simulator.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Jul 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2cf2db5a6caec489a83ddebbaaaf59980d8e8017

commit 2cf2db5a6caec489a83ddebbaaaf59980d8e8017
Author: arthursonzogni <arthursonzogni@chromium.org>
Date: Fri Jul 21 09:32:49 2017

Convert tests to use the NavigationSimulator.

In content/, this CL replace every renderer-initiated navigations
started with TestRenderFrameHost::SimulateNavigationStart() with a
navigation using the NavigationSimulator.

Bug: 728571

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation;master.tryserver.chromium.linux:linux_chromium_browser_side_navigation_rel
Change-Id: Ibe7bf13c645d202af1a7bb1dd9aecdc20a50d288
Reviewed-on: https://chromium-review.googlesource.com/574865
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488625}
[modify] https://crrev.com/2cf2db5a6caec489a83ddebbaaaf59980d8e8017/content/browser/frame_host/navigation_controller_impl_unittest.cc
[modify] https://crrev.com/2cf2db5a6caec489a83ddebbaaaf59980d8e8017/content/browser/renderer_host/render_process_host_unittest.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5e87fde87300fdc7fb115197d70002453ea1d5c7

commit 5e87fde87300fdc7fb115197d70002453ea1d5c7
Author: arthursonzogni <arthursonzogni@chromium.org>
Date: Fri Jul 28 21:27:18 2017

Convert tests to use the NavigationSimulator.

In download_request_limiter_unittest, convert each calls to
TestRenderFrameHost::NavigateAndCommitRendererInitiated()
to
NavigationSimulator::NavigateAndCommitFromDocument

Bug: 728571
Change-Id: I2a668ebb0a2179e63ed0b118811ad614c627ab6d
Reviewed-on: https://chromium-review.googlesource.com/580950
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490513}
[modify] https://crrev.com/5e87fde87300fdc7fb115197d70002453ea1d5c7/chrome/browser/download/download_request_limiter_unittest.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Aug 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6404022abdbdfd98775c085baeef201e48931096

commit 6404022abdbdfd98775c085baeef201e48931096
Author: clamy <clamy@chromium.org>
Date: Thu Aug 03 18:01:47 2017

Remove usage of deprecated navigation test method outside of content/

This CL removes most of the usages of
RenderFrameHostTester::SimulateNavigationStart outside of content/ in
favor of using NavigationSimulator. The goal is to have embedders of
content/ use the NavigationSimulator exclusively when writing unit tests
that involve navigation. This allows several tests to work with
PlzNavigate or OOPIF enabled.

BUG=728571

Change-Id: Iab0efe63d3c892da62ffe4e5cc2641e9af0f03a3
Reviewed-on: https://chromium-review.googlesource.com/582949
Commit-Queue: Camille Lamy <clamy@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Nathan Parker <nparker@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491791}
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/chrome/browser/browser_commands_unittest.cc
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/chrome/browser/extensions/extension_navigation_throttle_unittest.cc
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/chrome/browser/page_load_metrics/observers/ukm_page_load_metrics_observer_unittest.cc
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/chrome/browser/safe_browsing/safe_browsing_navigation_observer_unittest.cc
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/chrome/browser/ssl/insecure_sensitive_input_driver_unittest.cc
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/components/subresource_filter/content/browser/subframe_navigation_filtering_throttle_unittest.cc
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/content/public/test/navigation_simulator.cc
[modify] https://crrev.com/6404022abdbdfd98775c085baeef201e48931096/content/public/test/navigation_simulator.h

Project Member

Comment 10 by bugdroid1@chromium.org, Aug 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/63aa3f37b947a247d4aad3fbfa6d6a081d68a232

commit 63aa3f37b947a247d4aad3fbfa6d6a081d68a232
Author: arthursonzogni <arthursonzogni@chromium.org>
Date: Wed Aug 09 14:28:39 2017

Convert tests to use the NavigationSimulator.

In content/, this CL replaces renderer-initiated navigations started
with SendRendererInitiatedNavigationRequest() with a navigation using
the NavigationSimulator.

Bug: 728571
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_browser_side_navigation_rel;master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I80955ea7e4d9d1274a42cbe30b55603d7fffe0b4
Reviewed-on: https://chromium-review.googlesource.com/580930
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492969}
[modify] https://crrev.com/63aa3f37b947a247d4aad3fbfa6d6a081d68a232/content/browser/frame_host/navigator_impl_unittest.cc
[modify] https://crrev.com/63aa3f37b947a247d4aad3fbfa6d6a081d68a232/content/browser/frame_host/render_frame_host_manager_unittest.cc
[modify] https://crrev.com/63aa3f37b947a247d4aad3fbfa6d6a081d68a232/content/browser/web_contents/web_contents_impl_unittest.cc

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e97788658c0b72fa47612c1c70803abf3a7d4ad7

commit e97788658c0b72fa47612c1c70803abf3a7d4ad7
Author: clamy <clamy@chromium.org>
Date: Thu Aug 10 17:26:37 2017

Have NavigationSimulator support browser-initiated navigations

This CL adds support for simulating browser-initiated navigations using
NavigationSimulator. It removes the one usage outside of content/ of
RenderFrameHostTester::SimulateNavigationStart in simulation of
browser-initiated navigations. It also makes
TestWebContents::NavigateAndCommit use NavigationSimulator.

BUG=728571

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Ib295868db2a3aab5828a178aba7b92d77ed9b2ba
Reviewed-on: https://chromium-review.googlesource.com/583096
Commit-Queue: Camille Lamy <clamy@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Timothy Loh <timloh@chromium.org>
Reviewed-by: Nathan Parker <nparker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493442}
[modify] https://crrev.com/e97788658c0b72fa47612c1c70803abf3a7d4ad7/chrome/browser/net/net_error_tab_helper_unittest.cc
[modify] https://crrev.com/e97788658c0b72fa47612c1c70803abf3a7d4ad7/chrome/browser/permissions/permission_context_base_unittest.cc
[modify] https://crrev.com/e97788658c0b72fa47612c1c70803abf3a7d4ad7/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
[modify] https://crrev.com/e97788658c0b72fa47612c1c70803abf3a7d4ad7/content/browser/frame_host/navigation_handle_impl.cc
[modify] https://crrev.com/e97788658c0b72fa47612c1c70803abf3a7d4ad7/content/public/test/navigation_simulator.cc
[modify] https://crrev.com/e97788658c0b72fa47612c1c70803abf3a7d4ad7/content/public/test/navigation_simulator.h
[modify] https://crrev.com/e97788658c0b72fa47612c1c70803abf3a7d4ad7/content/test/test_render_frame_host.h
[modify] https://crrev.com/e97788658c0b72fa47612c1c70803abf3a7d4ad7/content/test/test_web_contents.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ea4484d54915e05b00f755723dbd5f7130f2fe2c

commit ea4484d54915e05b00f755723dbd5f7130f2fe2c
Author: Fernando Serboncini <fserb@chromium.org>
Date: Thu Aug 10 18:32:11 2017

Revert "Have NavigationSimulator support browser-initiated navigations"

This reverts commit e97788658c0b72fa47612c1c70803abf3a7d4ad7.

Reason for revert: This breaks Linux CFI unit_tests: https://uberchromegw.corp.google.com/i/chromium.memory/builders/Linux%20CFI/builds/904

Original change's description:
> Have NavigationSimulator support browser-initiated navigations
> 
> This CL adds support for simulating browser-initiated navigations using
> NavigationSimulator. It removes the one usage outside of content/ of
> RenderFrameHostTester::SimulateNavigationStart in simulation of
> browser-initiated navigations. It also makes
> TestWebContents::NavigateAndCommit use NavigationSimulator.
> 
> BUG=728571
> 
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
> Change-Id: Ib295868db2a3aab5828a178aba7b92d77ed9b2ba
> Reviewed-on: https://chromium-review.googlesource.com/583096
> Commit-Queue: Camille Lamy <clamy@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Reviewed-by: Nasko Oskov <nasko@chromium.org>
> Reviewed-by: Timothy Loh <timloh@chromium.org>
> Reviewed-by: Nathan Parker <nparker@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#493442}

TBR=nasko@chromium.org,felt@chromium.org,timloh@chromium.org,clamy@chromium.org,mmenke@chromium.org,nparker@chromium.org

Change-Id: I672aad0aabb65e5633e10750515fba12b88617aa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 728571
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Reviewed-on: https://chromium-review.googlesource.com/610940
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Fernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493475}
[modify] https://crrev.com/ea4484d54915e05b00f755723dbd5f7130f2fe2c/chrome/browser/net/net_error_tab_helper_unittest.cc
[modify] https://crrev.com/ea4484d54915e05b00f755723dbd5f7130f2fe2c/chrome/browser/permissions/permission_context_base_unittest.cc
[modify] https://crrev.com/ea4484d54915e05b00f755723dbd5f7130f2fe2c/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
[modify] https://crrev.com/ea4484d54915e05b00f755723dbd5f7130f2fe2c/content/browser/frame_host/navigation_handle_impl.cc
[modify] https://crrev.com/ea4484d54915e05b00f755723dbd5f7130f2fe2c/content/public/test/navigation_simulator.cc
[modify] https://crrev.com/ea4484d54915e05b00f755723dbd5f7130f2fe2c/content/public/test/navigation_simulator.h
[modify] https://crrev.com/ea4484d54915e05b00f755723dbd5f7130f2fe2c/content/test/test_render_frame_host.h
[modify] https://crrev.com/ea4484d54915e05b00f755723dbd5f7130f2fe2c/content/test/test_web_contents.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Aug 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/16332c5ba1ee5bfb54b40944a90a978148347421

commit 16332c5ba1ee5bfb54b40944a90a978148347421
Author: arthursonzogni <arthursonzogni@chromium.org>
Date: Fri Aug 11 09:57:07 2017

Introduce NavigationSimulator::ReadyToCommit().

Adds one intermediary state to the NavigationSimulator. It corresponds
to the point the navigation is ready to be committed in a renderer.

Bug: 728571
Change-Id: Id7c825510b1ee18ba4c3a52c72f9312f34b21ef7
Reviewed-on: https://chromium-review.googlesource.com/604799
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493693}
[modify] https://crrev.com/16332c5ba1ee5bfb54b40944a90a978148347421/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
[modify] https://crrev.com/16332c5ba1ee5bfb54b40944a90a978148347421/content/public/test/navigation_simulator.cc
[modify] https://crrev.com/16332c5ba1ee5bfb54b40944a90a978148347421/content/public/test/navigation_simulator.h

Project Member

Comment 14 by bugdroid1@chromium.org, Aug 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9143943d0b9f60fafe156b76bab7d3ea44f31722

commit 9143943d0b9f60fafe156b76bab7d3ea44f31722
Author: arthursonzogni <arthursonzogni@chromium.org>
Date: Wed Aug 16 16:32:37 2017

NavigationSimulator: Add SetHasNavigationGesture.

This will be useful for simulating renderer-initiated navigation that
are not user-initiated.

Several tests using SendRendererInitiatedNavigationRequest have been
updated to the NavigationSimulator thanks to this change.

Bug: 728571
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_browser_side_navigation_rel

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: If479c7f2abeab8aa9d737850d3e87e6c43ed68c4
Reviewed-on: https://chromium-review.googlesource.com/577539
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494815}
[modify] https://crrev.com/9143943d0b9f60fafe156b76bab7d3ea44f31722/content/browser/frame_host/navigator_impl_unittest.cc
[modify] https://crrev.com/9143943d0b9f60fafe156b76bab7d3ea44f31722/content/public/test/navigation_simulator.cc
[modify] https://crrev.com/9143943d0b9f60fafe156b76bab7d3ea44f31722/content/public/test/navigation_simulator.h

Project Member

Comment 15 by bugdroid1@chromium.org, Aug 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6e4072298023ab9a086a82a3c751e87e22c207ab

commit 6e4072298023ab9a086a82a3c751e87e22c207ab
Author: arthursonzogni <arthursonzogni@chromium.org>
Date: Wed Aug 16 16:36:55 2017

NavigationSimulator: convert tests.

Convert almost all calls to
TestRenderFrameHost::NavigateAndCommitRendererInititiated() into
NavigationSimulator::NavigateAndCommitFromDocument().

Bug: 728571
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Ib800df29a3833dae09d59c81a5d0076dfb66b1f8
Reviewed-on: https://chromium-review.googlesource.com/608237
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494818}
[modify] https://crrev.com/6e4072298023ab9a086a82a3c751e87e22c207ab/content/browser/frame_host/navigation_controller_impl_unittest.cc
[modify] https://crrev.com/6e4072298023ab9a086a82a3c751e87e22c207ab/content/browser/web_contents/web_contents_impl_unittest.cc
[modify] https://crrev.com/6e4072298023ab9a086a82a3c751e87e22c207ab/content/public/test/test_renderer_host.h
[modify] https://crrev.com/6e4072298023ab9a086a82a3c751e87e22c207ab/content/test/test_render_frame_host.h

Project Member

Comment 16 by bugdroid1@chromium.org, Aug 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/05ebb4e0abfdc476de381ef0ed7fc044e45b9325

commit 05ebb4e0abfdc476de381ef0ed7fc044e45b9325
Author: clamy <clamy@chromium.org>
Date: Thu Aug 17 18:59:05 2017

Reland "Have NavigationSimulator support browser-initiated navigations"

Initial commit message:
This CL adds support for simulating browser-initiated navigations using
NavigationSimulator. It removes the one usage outside of content/ of
RenderFrameHostTester::SimulateNavigationStart in simulation of
browser-initiated navigations. It also makes
TestWebContents::NavigateAndCommit use NavigationSimulator.

The original CL was reverted because it casted WebContents into their
TestWebContents version. This didn't work in tests that uses
NavigationSimulator and don't inherit from RenderViewHostHarness (but
use the RenderViewHostTestEnabler instead). In that case, WebContents
are not created as TestWebContents. The reland removes the cast.

BUG=728571
TBR=mmenke@chromium.org, timloh@chromium.org, nparker@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: If7203b1be972e623bdc4b06d7fdefc3b8f755405
Reviewed-on: https://chromium-review.googlesource.com/616938
Commit-Queue: Camille Lamy <clamy@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495263}
[modify] https://crrev.com/05ebb4e0abfdc476de381ef0ed7fc044e45b9325/chrome/browser/net/net_error_tab_helper_unittest.cc
[modify] https://crrev.com/05ebb4e0abfdc476de381ef0ed7fc044e45b9325/chrome/browser/permissions/permission_context_base_unittest.cc
[modify] https://crrev.com/05ebb4e0abfdc476de381ef0ed7fc044e45b9325/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
[modify] https://crrev.com/05ebb4e0abfdc476de381ef0ed7fc044e45b9325/content/browser/frame_host/navigation_handle_impl.cc
[modify] https://crrev.com/05ebb4e0abfdc476de381ef0ed7fc044e45b9325/content/public/test/navigation_simulator.cc
[modify] https://crrev.com/05ebb4e0abfdc476de381ef0ed7fc044e45b9325/content/public/test/navigation_simulator.h
[modify] https://crrev.com/05ebb4e0abfdc476de381ef0ed7fc044e45b9325/content/test/test_render_frame_host.h
[modify] https://crrev.com/05ebb4e0abfdc476de381ef0ed7fc044e45b9325/content/test/test_web_contents.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Aug 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6b0945df4b6aa2f184a230f19863ae7599bdeba8

commit 6b0945df4b6aa2f184a230f19863ae7599bdeba8
Author: Arthur Hemery <ahemery@chromium.org>
Date: Mon Aug 21 16:06:26 2017

PlzNavigate: Refactoring unit test to use NavigationSimulator

Replaced all usage of TestWebContents::StartNavigation within
content_unittests with a browser side NavigationSimulator.

Bug: 728571
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I2e91f9a85e6b264a8ba4951c3b63d8ccafc92daa
Reviewed-on: https://chromium-review.googlesource.com/621006
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495949}
[modify] https://crrev.com/6b0945df4b6aa2f184a230f19863ae7599bdeba8/content/browser/frame_host/navigation_controller_impl_unittest.cc
[modify] https://crrev.com/6b0945df4b6aa2f184a230f19863ae7599bdeba8/content/browser/frame_host/render_frame_host_manager_unittest.cc

Project Member

Comment 18 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7f99915029f2b1d2d5447867e32bedf975735eae

commit 7f99915029f2b1d2d5447867e32bedf975735eae
Author: clamy <clamy@chromium.org>
Date: Wed Aug 23 10:58:34 2017

Remove some navigation test functions from content/public

This CL removes some functions testing navigation from
RenderFrameHostTester as they are no longer used outside of content/ and
deprecated. Also marks the rest of the navigation testing functions in
this class as deprecated.

BUG=728571

Change-Id: Id643a84a231c7638199503681887190eec1485a8
Reviewed-on: https://chromium-review.googlesource.com/620714
Reviewed-by: Dmitry Titov <dimich@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496652}
[modify] https://crrev.com/7f99915029f2b1d2d5447867e32bedf975735eae/chrome/browser/offline_pages/recent_tab_helper_unittest.cc
[modify] https://crrev.com/7f99915029f2b1d2d5447867e32bedf975735eae/content/public/test/test_renderer_host.h
[modify] https://crrev.com/7f99915029f2b1d2d5447867e32bedf975735eae/content/test/test_render_frame_host.h

Project Member

Comment 19 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/511cf023ae293a768dd5cdf795cbbf958adb8a09

commit 511cf023ae293a768dd5cdf795cbbf958adb8a09
Author: clamy <clamy@chromium.org>
Date: Wed Aug 23 14:11:06 2017

Remove usage of WebContentsTester::SimulateNavigationStart

This CL removes usage of WebContentsTester::SimulateNavigationStart in
favor of using NavigationSimulator. Following this CL,
WebContentsTester::SimulateNavigationStart is no longer part of the
content/ public interface. This CL also removes the last two usages of
RenderFrameHostTester::SimulateNavigationError and
SimulateNavigationErrorPageCommit outside of content/. Hence, those
functions are also removed from the public interface.

BUG=728571

Change-Id: I2b14b1f24543476c289461d2e6b2b3ecf4667ec9
Reviewed-on: https://chromium-review.googlesource.com/621566
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: Nathan Parker <nparker@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496677}
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/chrome/browser/ntp_snippets/bookmark_last_visit_updater_unittest.cc
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/chrome/browser/safe_browsing/ui_manager_unittest.cc
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/chrome/browser/ui/webui/settings/people_handler_unittest.cc
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/content/public/test/navigation_simulator.cc
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/content/public/test/test_renderer_host.h
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/content/public/test/web_contents_tester.h
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/content/test/test_render_frame_host.h
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/content/test/test_web_contents.cc
[modify] https://crrev.com/511cf023ae293a768dd5cdf795cbbf958adb8a09/content/test/test_web_contents.h

Project Member

Comment 20 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/49bb5c7ec9b85cc4e25f20c12042a111e1c937d7

commit 49bb5c7ec9b85cc4e25f20c12042a111e1c937d7
Author: clamy <clamy@chromium.org>
Date: Wed Aug 23 16:11:37 2017

Remove SimulateNavigationCommit from content/public API

This CL removes RenderFrameHostTester::SimulateNavigationCommit from the
content/ public API. Use NavigationSimulator to simulate navigations
instead.

BUG=728571

Change-Id: I691df4385c202f261d0f543b3cc11b9e59038946
Reviewed-on: https://chromium-review.googlesource.com/623809
Commit-Queue: Camille Lamy <clamy@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496699}
[modify] https://crrev.com/49bb5c7ec9b85cc4e25f20c12042a111e1c937d7/chrome/browser/download/download_request_limiter_unittest.cc
[modify] https://crrev.com/49bb5c7ec9b85cc4e25f20c12042a111e1c937d7/chrome/browser/plugins/flash_temporary_permission_tracker_unittest.cc
[modify] https://crrev.com/49bb5c7ec9b85cc4e25f20c12042a111e1c937d7/content/public/test/test_renderer_host.h
[modify] https://crrev.com/49bb5c7ec9b85cc4e25f20c12042a111e1c937d7/content/test/test_render_frame_host.h

Project Member

Comment 21 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a167cae9354f47dc38209f0d328c6f55e73401da

commit a167cae9354f47dc38209f0d328c6f55e73401da
Author: clamy <clamy@chromium.org>
Date: Wed Aug 23 16:20:21 2017

Remove SendNavigate from content/public API

This CL removes RenderFrameHostTester::SendNavigate from the public API.
Use NavigationSimulator to test navigations instead.

BUG=728571

Change-Id: Iab7438acec97ae591b48d22c434ae291bfde513b
Reviewed-on: https://chromium-review.googlesource.com/623710
Commit-Queue: Camille Lamy <clamy@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496702}
[modify] https://crrev.com/a167cae9354f47dc38209f0d328c6f55e73401da/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
[modify] https://crrev.com/a167cae9354f47dc38209f0d328c6f55e73401da/content/public/test/test_renderer_host.h
[modify] https://crrev.com/a167cae9354f47dc38209f0d328c6f55e73401da/content/test/test_render_frame_host.h

Project Member

Comment 22 by bugdroid1@chromium.org, Aug 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/53422812e18a8358252ce7c3620f59b42ccc9b66

commit 53422812e18a8358252ce7c3620f59b42ccc9b66
Author: Arthur Hemery <ahemery@chromium.org>
Date: Tue Aug 29 12:18:51 2017

PlzNavigate: Refactoring unit tests to use NavigationSimulator

Removed all usage of WebContentsTester::TestDidNavigate in chromeOS
unit tests.

Bug: 728571
Change-Id: I77a8e09b15fb20154ca6658bccea236fa98fda82
Reviewed-on: https://chromium-review.googlesource.com/637993
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Alexander Alekseev <alemate@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498078}
[modify] https://crrev.com/53422812e18a8358252ce7c3620f59b42ccc9b66/chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc

Project Member

Comment 23 by bugdroid1@chromium.org, Aug 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da28d2ba23f99fa8b47e8522cd6ca6e4c777f2cd

commit da28d2ba23f99fa8b47e8522cd6ca6e4c777f2cd
Author: Arthur Hemery <ahemery@chromium.org>
Date: Wed Aug 30 09:06:57 2017

PlzNavigate: Refactoring unit tests to use NavigationSimulator

Removed all usage of WebContentsTester::TestDidNavigate in
site_engagement_service_unittest.cc.

Bug: 728571
Change-Id: I4e1deef8ea856b7ad78e8170fea009443d90531a
Reviewed-on: https://chromium-review.googlesource.com/638274
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498405}
[modify] https://crrev.com/da28d2ba23f99fa8b47e8522cd6ca6e4c777f2cd/chrome/browser/engagement/site_engagement_service_unittest.cc

Project Member

Comment 24 by bugdroid1@chromium.org, Aug 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7de58aab696e4a36f8d059252d8f92d6f5c88830

commit 7de58aab696e4a36f8d059252d8f92d6f5c88830
Author: Arthur Hemery <ahemery@chromium.org>
Date: Wed Aug 30 13:22:23 2017

PlzNavigate: Refactoring unit tests to use NavigationSimulator

Removed the usage of TestWebContents->DidNavigate variants in:
- render_frame_host_manager_unittest.cc
- devtools_manager_unittest.cc
- web_contents_impl_unittest.cc (derived only)

A CL will follow for base usage in web_contents_impl_unittest.cc
(~60 uses).

Bug: 728571
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I600067df11875d31cbd9c5c1dab6a48f25e06843
Reviewed-on: https://chromium-review.googlesource.com/626063
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498442}
[modify] https://crrev.com/7de58aab696e4a36f8d059252d8f92d6f5c88830/content/browser/devtools/devtools_manager_unittest.cc
[modify] https://crrev.com/7de58aab696e4a36f8d059252d8f92d6f5c88830/content/browser/frame_host/render_frame_host_manager_unittest.cc
[modify] https://crrev.com/7de58aab696e4a36f8d059252d8f92d6f5c88830/content/browser/web_contents/web_contents_impl_unittest.cc

Project Member

Comment 25 by bugdroid1@chromium.org, Aug 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dad53b0e17601f7520b9484b9076410ab1082124

commit dad53b0e17601f7520b9484b9076410ab1082124
Author: Arthur Hemery <ahemery@chromium.org>
Date: Thu Aug 31 05:32:49 2017

PlzNavigate: Refactoring unit tests to use NavigationSimulator

Removed all usage of WebContentsTester::TestDidNavigate in
site_engagement_helper_unittest.cc.

Bug: 728571
Change-Id: I6d87af439398bed003f7993ed8e4ab58f8702b40
Reviewed-on: https://chromium-review.googlesource.com/638570
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498761}
[modify] https://crrev.com/dad53b0e17601f7520b9484b9076410ab1082124/chrome/browser/engagement/site_engagement_helper_unittest.cc

Project Member

Comment 26 by bugdroid1@chromium.org, Aug 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bc1714615d0a0b6c50724ecdd212c41b01bbe3a3

commit bc1714615d0a0b6c50724ecdd212c41b01bbe3a3
Author: Arthur Hemery <ahemery@chromium.org>
Date: Thu Aug 31 06:01:11 2017

PlzNavigate: Refactoring unit tests to use NavigationSimulator

Removed (almost) all usage of WebContentsTester::TestDidNavigate in
safe_browsing_blocking_page_unittest.cc.

Bug: 728571
Change-Id: Id16f7f26c7f88fcfe5bf41c8c8de9f8fb0580353
Reviewed-on: https://chromium-review.googlesource.com/640693
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Adrienne Porter Felt <felt@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498768}
[modify] https://crrev.com/bc1714615d0a0b6c50724ecdd212c41b01bbe3a3/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc

Project Member

Comment 27 by bugdroid1@chromium.org, Oct 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc

commit f205303ca4f9d6176ec9f5c3efa6cd752f6023fc
Author: clamy <clamy@chromium.org>
Date: Fri Oct 20 16:01:59 2017

Introduce NavigationSimulator::Reload

This CL introduces new methods to simulate reloads in
NavigationSimulator. It replaces usage of
RenderViewHostTestHarness::Reload and
RenderViewHostTestHarness::FailedReload by these new methods.

BUG=728571

Change-Id: I246f86d357878d43e6cab155b6be8a100028686a
Reviewed-on: https://chromium-review.googlesource.com/624028
Commit-Queue: Camille Lamy <clamy@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: Tim Volodine <timvolodine@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510452}
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/chrome/browser/download/download_request_limiter_unittest.cc
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/chrome/browser/extensions/active_tab_unittest.cc
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/chrome/browser/extensions/extension_action_runner_unittest.cc
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/chrome/browser/plugins/flash_temporary_permission_tracker_unittest.cc
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/chrome/browser/translate/translate_manager_render_view_host_unittest.cc
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/content/public/test/navigation_simulator.cc
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/content/public/test/navigation_simulator.h
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/content/public/test/test_renderer_host.cc
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/content/public/test/test_renderer_host.h
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/content/test/test_render_frame_host.cc
[modify] https://crrev.com/f205303ca4f9d6176ec9f5c3efa6cd752f6023fc/content/test/test_render_frame_host.h

Project Member

Comment 28 by bugdroid1@chromium.org, Oct 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a4503529b9998ffca9494aa8ba3c56b33fab7c24

commit a4503529b9998ffca9494aa8ba3c56b33fab7c24
Author: clamy <clamy@chromium.org>
Date: Fri Oct 27 22:10:15 2017

Remove deprecated test functions

This CL removes two deprecated test functions from the WebContentsTester
interface and replaces their usage with NavigationSimulator.

BUG=728571

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I33f8e15aba4c478ef57a09ae27e2f288adf6daff
Reviewed-on: https://chromium-review.googlesource.com/730715
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Nathan Parker <nparker@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512317}
[modify] https://crrev.com/a4503529b9998ffca9494aa8ba3c56b33fab7c24/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
[modify] https://crrev.com/a4503529b9998ffca9494aa8ba3c56b33fab7c24/chrome/browser/safe_browsing/threat_details_unittest.cc
[modify] https://crrev.com/a4503529b9998ffca9494aa8ba3c56b33fab7c24/content/browser/frame_host/navigation_controller_impl_unittest.cc
[modify] https://crrev.com/a4503529b9998ffca9494aa8ba3c56b33fab7c24/content/public/test/navigation_simulator.cc
[modify] https://crrev.com/a4503529b9998ffca9494aa8ba3c56b33fab7c24/content/public/test/web_contents_tester.h
[modify] https://crrev.com/a4503529b9998ffca9494aa8ba3c56b33fab7c24/content/test/test_web_contents.cc
[modify] https://crrev.com/a4503529b9998ffca9494aa8ba3c56b33fab7c24/content/test/test_web_contents.h

Project Member

Comment 29 by bugdroid1@chromium.org, Nov 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3eb72f2b141d0a58f574260465d059cc183740b1

commit 3eb72f2b141d0a58f574260465d059cc183740b1
Author: Arthur Hemery <ahemery@chromium.org>
Date: Wed Nov 29 09:39:36 2017

Introducing NavigationSimulator back/forward

Added capability to NavigationSimulator to do back and forward
navigations. Also modified some unit tests that were using it.

Bug: 728571
Change-Id: I6ef5a6609543b90ec9309be1830c866d04f0fa3d
Reviewed-on: https://chromium-review.googlesource.com/647539
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Reviewed-by: Jialiu Lin <jialiul@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520053}
[modify] https://crrev.com/3eb72f2b141d0a58f574260465d059cc183740b1/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
[modify] https://crrev.com/3eb72f2b141d0a58f574260465d059cc183740b1/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc
[modify] https://crrev.com/3eb72f2b141d0a58f574260465d059cc183740b1/content/browser/renderer_host/render_process_host_unittest.cc
[modify] https://crrev.com/3eb72f2b141d0a58f574260465d059cc183740b1/content/public/test/navigation_simulator.cc
[modify] https://crrev.com/3eb72f2b141d0a58f574260465d059cc183740b1/content/public/test/navigation_simulator.h

Project Member

Comment 30 by bugdroid1@chromium.org, Jul 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c65bc1abc46c630c53a3e21bb0670dc602e8d37d

commit c65bc1abc46c630c53a3e21bb0670dc602e8d37d
Author: Arthur Hemery <ahemery@chromium.org>
Date: Thu Jul 12 12:20:36 2018

Navigation: Refactoring WebContents unittests to use NavigationSimulator

Removed the usage of TestWebContents->DidNavigate variants in
web_contents_impl_unittest.cc. Some usage remains, linked to
overlapping navigations and other specific usages.

Bug: 728571
Change-Id: Ie2d6b73cb5deea077f720114fdd45ab4ee714c0a
Reviewed-on: https://chromium-review.googlesource.com/1076240
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574533}
[modify] https://crrev.com/c65bc1abc46c630c53a3e21bb0670dc602e8d37d/content/browser/web_contents/web_contents_impl_unittest.cc

Sign in to add a comment