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

Unified Diff: content/browser/service_worker/service_worker_context_unittest.cc

Issue 1471763003: [BackgroundSync] Only allow SyncManager.register to occur from main frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split
Patch Set: Address comments from PS6 Created 5 years, 1 month 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: content/browser/service_worker/service_worker_context_unittest.cc
diff --git a/content/browser/service_worker/service_worker_context_unittest.cc b/content/browser/service_worker/service_worker_context_unittest.cc
index 550db57c7bc3938e43995ed592541fed0dc595e1..3071b6d5172297d135b71476de2bc1c85a8c7a34 100644
--- a/content/browser/service_worker/service_worker_context_unittest.cc
+++ b/content/browser/service_worker/service_worker_context_unittest.cc
@@ -525,31 +525,6 @@ TEST_F(ServiceWorkerContextTest, RegisterDuplicateScript) {
EXPECT_EQ(old_registration_id, notifications_[1].registration_id);
}
-TEST_F(ServiceWorkerContextTest, HasWindowProviderHost) {
- const int kRenderProcessId = 1;
- const GURL kOrigin = GURL("http://www.example.com/");
- const GURL kOriginOther = GURL("https://www.example.com/");
- int provider_id = 1;
-
- ServiceWorkerProviderHost* host_window(new ServiceWorkerProviderHost(
- kRenderProcessId, MSG_ROUTING_NONE, provider_id++,
- SERVICE_WORKER_PROVIDER_FOR_WINDOW, context()->AsWeakPtr(), nullptr));
- host_window->SetDocumentUrl(kOrigin);
-
- // Host2 (provider_id=2): process_id=2, origin2.
- ServiceWorkerProviderHost* host_worker(new ServiceWorkerProviderHost(
- kRenderProcessId, MSG_ROUTING_NONE, provider_id++,
- SERVICE_WORKER_PROVIDER_FOR_WORKER, context()->AsWeakPtr(), nullptr));
- host_worker->SetDocumentUrl(kOrigin);
-
- EXPECT_FALSE(context()->HasWindowProviderHost(kOrigin));
- context()->AddProviderHost(make_scoped_ptr(host_worker));
- EXPECT_FALSE(context()->HasWindowProviderHost(kOrigin));
- context()->AddProviderHost(make_scoped_ptr(host_window));
- EXPECT_TRUE(context()->HasWindowProviderHost(kOrigin));
- EXPECT_FALSE(context()->HasWindowProviderHost(kOriginOther));
-}
-
TEST_F(ServiceWorkerContextTest, ProviderHostIterator) {
const int kRenderProcessId1 = 1;
const int kRenderProcessId2 = 2;

Powered by Google App Engine
This is Rietveld 408576698