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

Issue 2682313002: Introduce NavigationSimulator to use in unit tests (Closed)

Created:
3 years, 10 months ago by clamy
Modified:
3 years, 9 months ago
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, nasko+codewatch_chromium.org, subresource-filter-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce NavigationSimulator to use in unit tests This CL introduces a new helper class to simulate navigations in unit tests, the NavigationSimulator. Simulating navigations has been hard in the past, as numerous unit tests simulate a wrong ordering of IPCs or use the wrong RenderFrameHost to commit the navigation. Some WebContentsObserver methods may also not be called. The goal of the new class is to give users of the content/ API an easy way to simulate navigations that stays up-to-date with the actual code used in production. BUG=688393 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2682313002 Cr-Commit-Position: refs/heads/master@{#454279} Committed: https://chromium.googlesource.com/chromium/src/+/6b6831f2f18308600d867887809305af8642c2ed

Patch Set 1 #

Patch Set 2 : Introduce NavigationSimulator #

Patch Set 3 : Introduce NavigationSimulator #

Total comments: 4

Patch Set 4 : Added same-page navigation simulation #

Total comments: 33

Patch Set 5 : Rebase #

Patch Set 6 : Addressed comments #

Patch Set 7 : Rebase #

Patch Set 8 : Fixed issue with OOPIF #

Total comments: 4

Patch Set 9 : Rebase #

Patch Set 10 : Removed impl split #

Total comments: 6

Patch Set 11 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+780 lines, -91 lines) Patch
M components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc View 1 2 3 4 5 6 7 8 9 10 12 chunks +40 lines, -45 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.h View 1 2 3 4 5 6 7 8 3 chunks +18 lines, -15 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -1 line 0 comments Download
M content/public/common/referrer.h View 1 2 chunks +4 lines, -4 lines 0 comments Download
M content/public/common/referrer.cc View 1 2 chunks +21 lines, -25 lines 0 comments Download
A content/public/test/navigation_simulator.h View 1 2 3 4 5 6 7 8 9 1 chunk +170 lines, -0 lines 0 comments Download
A content/public/test/navigation_simulator.cc View 1 2 3 4 5 6 7 8 9 1 chunk +510 lines, -0 lines 0 comments Download
M content/public/test/test_renderer_host.h View 1 2 3 4 5 6 7 8 9 1 chunk +9 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 65 (39 generated)
clamy
@engedy: I'm trying to fix issue 688393 and have this preliminary patch. With this, all ...
3 years, 10 months ago (2017-02-09 15:11:36 UTC) #4
engedy
Thanks a lot for working on this! The test `WhitelistSiteOnReload` makes decisions based on the ...
3 years, 10 months ago (2017-02-09 18:42:24 UTC) #6
Bryan McQuade
On 2017/02/09 at 18:42:24, engedy wrote: > Thanks a lot for working on this! > ...
3 years, 10 months ago (2017-02-09 19:43:48 UTC) #7
clamy
On 2017/02/09 19:43:48, Bryan McQuade wrote: > On 2017/02/09 at 18:42:24, engedy wrote: > > ...
3 years, 10 months ago (2017-02-10 13:14:15 UTC) #8
engedy
On 2017/02/10 13:14:15, clamy wrote: > On 2017/02/09 19:43:48, Bryan McQuade wrote: > > On ...
3 years, 10 months ago (2017-02-10 13:23:33 UTC) #9
clamy
@engedy,bmcquade: The latest CL adds a new class to simulate navigations. Does the interface look ...
3 years, 10 months ago (2017-02-14 17:08:07 UTC) #19
Bryan McQuade
thank you for this change! one request but otherwise seems good. thanks very much for ...
3 years, 10 months ago (2017-02-14 17:26:27 UTC) #20
engedy
This looks great! I am preparing a CL to fix these tests so they no ...
3 years, 10 months ago (2017-02-15 11:53:22 UTC) #23
clamy
https://codereview.chromium.org/2682313002/diff/40001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc File components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc (left): https://codereview.chromium.org/2682313002/diff/40001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc#oldcode246 components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc:246: if (!content::IsBrowserSideNavigationEnabled()) { On 2017/02/14 17:26:27, Bryan McQuade wrote: ...
3 years, 10 months ago (2017-02-15 12:57:21 UTC) #25
clamy
https://codereview.chromium.org/2682313002/diff/40001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc File components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc (right): https://codereview.chromium.org/2682313002/diff/40001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc#newcode338 components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc:338: content::RenderFrameHostTester::For(main_rfh()) On 2017/02/15 11:53:22, engedy wrote: > Do you ...
3 years, 10 months ago (2017-02-15 12:57:40 UTC) #27
engedy
Camille, here is the promised CL: https://codereview.chromium.org/2695243002/. We would still need to somehow expose to ...
3 years, 10 months ago (2017-02-15 14:33:31 UTC) #30
nasko
Adding creis@ and nick@, who can continue the review, as I will be out next ...
3 years, 10 months ago (2017-02-16 18:47:59 UTC) #32
ncarter (slow)
https://codereview.chromium.org/2682313002/diff/60001/content/public/test/navigation_simulator.h File content/public/test/navigation_simulator.h (right): https://codereview.chromium.org/2682313002/diff/60001/content/public/test/navigation_simulator.h#newcode20 content/public/test/navigation_simulator.h:20: // renderer-initiated navigations. Should this comment, or the comment ...
3 years, 10 months ago (2017-02-16 23:36:32 UTC) #33
clamy
Thanks! https://codereview.chromium.org/2682313002/diff/60001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc File components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc (right): https://codereview.chromium.org/2682313002/diff/60001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc#newcode5 components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc:5: #include "components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h" On 2017/02/16 18:47:58, nasko (out until ...
3 years, 10 months ago (2017-02-17 17:34:53 UTC) #35
Charlie Harrison
I have a bunch of CLs dependent on this test infrastructure. nick@, friendly ping?
3 years, 10 months ago (2017-02-23 01:28:15 UTC) #44
ncarter (slow)
On 2017/02/23 01:28:15, Charlie Harrison wrote: > I have a bunch of CLs dependent on ...
3 years, 10 months ago (2017-02-23 21:50:49 UTC) #45
ncarter (slow)
lgtm https://codereview.chromium.org/2682313002/diff/140001/content/test/navigation_simulator_impl.h File content/test/navigation_simulator_impl.h (right): https://codereview.chromium.org/2682313002/diff/140001/content/test/navigation_simulator_impl.h#newcode21 content/test/navigation_simulator_impl.h:21: class NavigationSimulatorImpl : public NavigationSimulator, It looks like ...
3 years, 9 months ago (2017-02-28 23:27:44 UTC) #46
Bryan McQuade
LGTM, thanks!
3 years, 9 months ago (2017-03-01 02:10:27 UTC) #47
clamy
@engedy: PTAL at the changes in components/subresource_filter @nick: following offline drive-by comment from jam@, I've ...
3 years, 9 months ago (2017-03-01 16:18:09 UTC) #50
ncarter (slow)
On 2017/03/01 16:18:09, clamy wrote: > @engedy: PTAL at the changes in components/subresource_filter > @nick: ...
3 years, 9 months ago (2017-03-01 18:03:00 UTC) #53
engedy
components/subresource_filter LGTM % nits. Thanks a lot for working on NavigationSimulator, it greatly increases the ...
3 years, 9 months ago (2017-03-02 10:38:10 UTC) #54
clamy
Thanks! https://codereview.chromium.org/2682313002/diff/180001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc File components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc (left): https://codereview.chromium.org/2682313002/diff/180001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc#oldcode17 components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc:17: #include "content/public/common/browser_side_navigation_policy.h" On 2017/03/02 10:38:10, engedy (slow) wrote: ...
3 years, 9 months ago (2017-03-02 13:11:18 UTC) #55
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/2682313002/200001
3 years, 9 months ago (2017-03-02 13:11:39 UTC) #58
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/243055)
3 years, 9 months ago (2017-03-02 14:58:50 UTC) #60
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/2682313002/200001
3 years, 9 months ago (2017-03-02 15:46:31 UTC) #62
commit-bot: I haz the power
3 years, 9 months ago (2017-03-02 16:31:48 UTC) #65
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as
https://chromium.googlesource.com/chromium/src/+/6b6831f2f18308600d8678878093...

Powered by Google App Engine
This is Rietveld 408576698