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

Unified Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 2652393005: Suppress NEW_NAVIGATION_ENTRY prerenderer failures for ORIGIN_OFFLINE (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_browsertest.cc
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc
index 4b830e7abdcb9cf5c526a9846059ba17ac7ed8fc..5de302c3ffc72c3e1fdb7e5558cd6900babaf808 100644
--- a/chrome/browser/prerender/prerender_browsertest.cc
+++ b/chrome/browser/prerender/prerender_browsertest.cc
@@ -3110,6 +3110,31 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderNewNavigationEntry) {
FINAL_STATUS_NEW_NAVIGATION_ENTRY, 1);
}
+// Checks that the prerendering of a page for ORIGIN_OFFLINE is not canceled
+// when the prerendered page tries to make a second navigation entry.
+IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
+ PrerenderNewNavigationEntryForOffline) {
+ // Navigate to about:blank to get the session storage namespace.
+ ui_test_utils::NavigateToURL(current_browser(), GURL(url::kAboutBlankURL));
+ content::SessionStorageNamespace* storage_namespace =
+ GetActiveWebContents()
+ ->GetController()
+ .GetDefaultSessionStorageNamespace();
+
+ std::unique_ptr<TestPrerender> test_prerender =
+ prerender_contents_factory()->ExpectPrerenderContents(
+ FINAL_STATUS_APP_TERMINATING);
+
+ const GURL url =
+ src_server()->GetURL(MakeAbsolute("/prerender/prerender_new_entry.html"));
+ std::unique_ptr<PrerenderHandle> prerender_handle(
+ GetPrerenderManager()->AddPrerenderForOffline(url, storage_namespace,
+ gfx::Size(640, 480)));
+ ASSERT_EQ(prerender_handle->contents(), test_prerender->contents());
+ test_prerender->WaitForLoads(2);
+ ASSERT_EQ(1, GetActiveWebContents()->GetController().GetEntryCount());
+}
+
// Attempt a swap-in in a new tab. The session storage doesn't match, so it
// should not swap.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderPageNewTab) {
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698