diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-30 08:47:13 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-30 08:47:13 +0000 |
commit | 60d6cca71d7aeed69b5f11abe1273063b94d6d13 (patch) | |
tree | 15dea83cc3383461dfbb386cefb7e4dcc3da7378 /content/browser/renderer_host/test_render_view_host.cc | |
parent | dfe1bef94ad69bb3f04e674629f40bf8a6b9cbba (diff) | |
download | chromium_src-60d6cca71d7aeed69b5f11abe1273063b94d6d13.zip chromium_src-60d6cca71d7aeed69b5f11abe1273063b94d6d13.tar.gz chromium_src-60d6cca71d7aeed69b5f11abe1273063b94d6d13.tar.bz2 |
Switch content_shell from using PruneAllButActive to a more explicit approach
During layout tests, we want to reuse one WebContents for running multiple
layout tests. Since layout tests assume that they're the first entry in the
session history, we need to reset the session history.
DumpRenderTree achieved this by just killing the NavigationController. Since
that's not possible in the content module, I used the instant api
PruneAllButActive. This API, however, depends on the currently active RenderView
being the last in the session history, which is almost impossible to guarantee
in practice.
Instead, I added a flag to LoadURLParams that instructs the NavigationController
to reset itself as soon as the navigation to the next test commits.
BUG=111316
TEST=the fast/history tests don't fail flakily
TBR=creis@chromium.org, jam@chromium.org
Review URL: https://codereview.chromium.org/14134003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/test_render_view_host.cc')
-rw-r--r-- | content/browser/renderer_host/test_render_view_host.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc index cff1d21..0e1792a 100644 --- a/content/browser/renderer_host/test_render_view_host.cc +++ b/content/browser/renderer_host/test_render_view_host.cc @@ -241,6 +241,7 @@ TestRenderViewHost::TestRenderViewHost( render_view_created_(false), delete_counter_(NULL), simulate_fetch_via_proxy_(false), + simulate_history_list_was_cleared_(false), contents_mime_type_("text/html") { // For normal RenderViewHosts, this is freed when |Shutdown()| is // called. For TestRenderViewHost, the view is explicitly @@ -322,6 +323,7 @@ void TestRenderViewHost::SendNavigateWithParameters( params.socket_address.set_host("2001:db8::1"); params.socket_address.set_port(80); params.was_fetched_via_proxy = simulate_fetch_via_proxy_; + params.history_list_was_cleared = simulate_history_list_was_cleared_; params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); params.original_request_url = original_request_url; @@ -362,6 +364,10 @@ void TestRenderViewHost::set_simulate_fetch_via_proxy(bool proxy) { simulate_fetch_via_proxy_ = proxy; } +void TestRenderViewHost::set_simulate_history_list_was_cleared(bool cleared) { + simulate_history_list_was_cleared_ = cleared; +} + RenderViewHostImplTestHarness::RenderViewHostImplTestHarness() { } |