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

Unified Diff: chrome/browser/site_details_browsertest.cc

Issue 2562703005: Make the IsolateExtensions test reliably flaky by adding a slow unload handler.
Patch Set: Created 4 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/site_details_browsertest.cc
diff --git a/chrome/browser/site_details_browsertest.cc b/chrome/browser/site_details_browsertest.cc
index a43f5243a0b58decdde9501fe4d76a932363a59b..95e190eb71d9bb7fc0cae6832cc669c2c1b79673 100644
--- a/chrome/browser/site_details_browsertest.cc
+++ b/chrome/browser/site_details_browsertest.cc
@@ -211,8 +211,11 @@ class SiteDetailsBrowserTest : public ExtensionBrowserTest {
dir->WriteFile(FILE_PATH_LITERAL("blank_iframe.html"),
base::StringPrintf("<html><body>%s, blank iframe:"
" <iframe width=80 height=80></iframe>"
+ "<script src='foo.js'></script>"
"</body></html>",
name.c_str()));
+ std::string slow_url =
+ embedded_test_server()->GetURL("w.com", "/slow?10").spec();
std::string iframe_url =
embedded_test_server()
->GetURL("w.com", "/cross_site_iframe_factory.html?w")
@@ -222,6 +225,13 @@ class SiteDetailsBrowserTest : public ExtensionBrowserTest {
->GetURL("x.com", "/cross_site_iframe_factory.html?x")
.spec();
dir->WriteFile(
+ FILE_PATH_LITERAL("foo.js"),
+ base::StringPrintf("window.addEventListener('unload', function(event) {"
+ " var request = new XMLHttpRequest();"
+ " request.open('GET', '%s', false);"
+ " request.send(null);"
+ "});", slow_url.c_str()));
+ dir->WriteFile(
FILE_PATH_LITERAL("http_iframe.html"),
base::StringPrintf("<html><body>%s, http:// iframe:"
" <iframe width=80 height=80 src='%s'></iframe>"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698