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

Unified Diff: Source/WebKit/chromium/tests/PrerenderingTest.cpp

Issue 11828063: Merge 138173 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 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 | « Source/WebCore/loader/LinkLoader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/tests/PrerenderingTest.cpp
===================================================================
--- Source/WebKit/chromium/tests/PrerenderingTest.cpp (revision 139388)
+++ Source/WebKit/chromium/tests/PrerenderingTest.cpp (working copy)
@@ -437,4 +437,23 @@
webPrerender.didStartPrerender();
}
+TEST_F(PrerenderingTest, FastRemoveElement)
+{
+ initialize("http://www.foo.com/", "prerender/single_prerender.html");
+
+ WebPrerender webPrerender = prerendererClient()->releaseWebPrerender();
+ EXPECT_FALSE(webPrerender.isNull());
+
+ EXPECT_EQ(1u, prerenderingSupport()->addCount(webPrerender));
+ EXPECT_EQ(1u, prerenderingSupport()->totalCount());
+
+ // Race removing & starting the prerender against each other, as if the element was removed very quickly.
+ executeScript("removePrerender()");
+ EXPECT_FALSE(webPrerender.isNull());
+ webPrerender.didStartPrerender();
+
+ // The page should be totally disconnected from the Prerender at this point, so the console should not have updated.
+ EXPECT_EQ(0u, consoleLength());
+}
+
} // namespace
« no previous file with comments | « Source/WebCore/loader/LinkLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698