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

Unified Diff: trunk/src/content/browser/service_worker/service_worker_browsertest.cc

Issue 296053013: Revert 272142 "Save running SW instance info, including its Site..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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
Index: trunk/src/content/browser/service_worker/service_worker_browsertest.cc
===================================================================
--- trunk/src/content/browser/service_worker/service_worker_browsertest.cc (revision 272148)
+++ trunk/src/content/browser/service_worker/service_worker_browsertest.cc (working copy)
@@ -550,6 +550,10 @@
continuation.Run();
}
+ int RenderProcessID() {
+ return shell()->web_contents()->GetRenderProcessHost()->GetID();
+ }
+
void FindRegistrationOnIO(const GURL& document_url,
ServiceWorkerStatusCode* status,
GURL* script_url,
@@ -579,21 +583,7 @@
}
};
-static int CountRenderProcessHosts() {
- int result = 0;
- for (RenderProcessHost::iterator iter(RenderProcessHost::AllHostsIterator());
- !iter.IsAtEnd();
- iter.Advance()) {
- result++;
- }
- return result;
-}
-
IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) {
- // Close the only window to be sure we're not re-using its RenderProcessHost.
- shell()->Close();
- EXPECT_EQ(0, CountRenderProcessHosts());
-
const std::string kWorkerUrl = "/service_worker/fetch_event.js";
// Unregistering nothing should return true.
@@ -607,19 +597,6 @@
run_loop.Run();
}
- // If we use a worker URL that doesn't exist, registration fails.
- {
- base::RunLoop run_loop;
- public_context()->RegisterServiceWorker(
- embedded_test_server()->GetURL("/*"),
- embedded_test_server()->GetURL("/does/not/exist"),
- base::Bind(&ServiceWorkerBlackBoxBrowserTest::ExpectResultAndRun,
- false,
- run_loop.QuitClosure()));
- run_loop.Run();
- }
- EXPECT_EQ(0, CountRenderProcessHosts());
-
// Register returns when the promise would be resolved.
{
base::RunLoop run_loop;
@@ -631,7 +608,6 @@
run_loop.QuitClosure()));
run_loop.Run();
}
- EXPECT_EQ(1, CountRenderProcessHosts());
// Registering again should succeed, although the algo still
// might not be complete.
@@ -660,9 +636,6 @@
run_loop.QuitClosure()));
run_loop.Run();
}
- EXPECT_GE(1, CountRenderProcessHosts()) << "Unregistering doesn't stop the "
- "workers eagerly, so their RPHs "
- "can still be running.";
// Should not be able to find it.
{

Powered by Google App Engine
This is Rietveld 408576698