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

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

Issue 563923005: ServiceWorker: SWProviderHost no longer have to retain SWVersions (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « content/browser/service_worker/service_worker_provider_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_provider_host_unittest.cc
diff --git a/content/browser/service_worker/service_worker_provider_host_unittest.cc b/content/browser/service_worker/service_worker_provider_host_unittest.cc
index a4af6caae1f20f3a410c71b433a20e2803ef1f51..a29495f107d288a10925665d9e3bfb66fb6e08a7 100644
--- a/content/browser/service_worker/service_worker_provider_host_unittest.cc
+++ b/content/browser/service_worker/service_worker_provider_host_unittest.cc
@@ -57,17 +57,6 @@ class ServiceWorkerProviderHostTest : public testing::Test {
return context_->process_manager()->PatternHasProcessToRun(pattern_);
}
- void VerifyVersionAttributes(
- base::WeakPtr<ServiceWorkerProviderHost> provider_host,
- ServiceWorkerVersion* installing,
- ServiceWorkerVersion* waiting,
- ServiceWorkerVersion* active) {
- EXPECT_EQ(installing, provider_host->installing_version_.get());
- EXPECT_EQ(waiting, provider_host->waiting_version_.get());
- EXPECT_EQ(active, provider_host->active_version_.get());
- EXPECT_FALSE(provider_host->controlling_version_.get());
- }
-
content::TestBrowserThreadBundle thread_bundle_;
scoped_ptr<EmbeddedWorkerTestHelper> helper_;
ServiceWorkerContextCore* context_;
@@ -160,73 +149,4 @@ TEST_F(ServiceWorkerProviderHostTest,
ASSERT_FALSE(HasProcessToRun());
}
-TEST_F(ServiceWorkerProviderHostTest,
- ObserveVersionAttributesChanged_Basic) {
- provider_host1_->AssociateRegistration(registration_.get());
- provider_host2_->AssociateRegistration(registration_.get());
- VerifyVersionAttributes(provider_host1_, NULL, NULL, NULL);
- VerifyVersionAttributes(provider_host2_, NULL, NULL, NULL);
-
- registration_->SetInstallingVersion(version_.get());
- VerifyVersionAttributes(provider_host1_, version_.get(), NULL, NULL);
- VerifyVersionAttributes(provider_host2_, version_.get(), NULL, NULL);
-
- registration_->SetWaitingVersion(version_.get());
- VerifyVersionAttributes(provider_host1_, NULL, version_.get(), NULL);
- VerifyVersionAttributes(provider_host2_, NULL, version_.get(), NULL);
-
- // Disassociating the registration should clear all version attributes.
- provider_host2_->DisassociateRegistration();
- VerifyVersionAttributes(provider_host1_, NULL, version_.get(), NULL);
- VerifyVersionAttributes(provider_host2_, NULL, NULL, NULL);
-
- // Shouldn't notify the disassociated provider of the change.
- registration_->SetActiveVersion(version_.get());
- VerifyVersionAttributes(provider_host1_, NULL, NULL, version_.get());
- VerifyVersionAttributes(provider_host2_, NULL, NULL, NULL);
-}
-
-TEST_F(ServiceWorkerProviderHostTest,
- ObserveVersionAttributesChanged_MultipleVersions) {
- provider_host1_->AssociateRegistration(registration_.get());
- provider_host2_->AssociateRegistration(registration_.get());
- VerifyVersionAttributes(provider_host1_, NULL, NULL, NULL);
- VerifyVersionAttributes(provider_host2_, NULL, NULL, NULL);
-
- scoped_refptr<ServiceWorkerVersion> version1 = new ServiceWorkerVersion(
- registration_.get(), script_url_, 10L, context_->AsWeakPtr());
- scoped_refptr<ServiceWorkerVersion> version2 = new ServiceWorkerVersion(
- registration_.get(), script_url_, 20L, context_->AsWeakPtr());
-
- registration_->SetInstallingVersion(version1.get());
- VerifyVersionAttributes(provider_host1_, version1.get(), NULL, NULL);
- VerifyVersionAttributes(provider_host2_, version1.get(), NULL, NULL);
-
- registration_->SetWaitingVersion(version1.get());
- VerifyVersionAttributes(provider_host1_, NULL, version1.get(), NULL);
- VerifyVersionAttributes(provider_host2_, NULL, version1.get(), NULL);
-
- registration_->SetInstallingVersion(version2.get());
- VerifyVersionAttributes(
- provider_host1_, version2.get(), version1.get(), NULL);
- VerifyVersionAttributes(
- provider_host2_, version2.get(), version1.get(), NULL);
-
- // Disassociating the registration should clear all version attributes.
- provider_host2_->DisassociateRegistration();
- VerifyVersionAttributes(
- provider_host1_, version2.get(), version1.get(), NULL);
- VerifyVersionAttributes(provider_host2_, NULL, NULL, NULL);
-
- // Shouldn't notify the disassociated provider of the change.
- registration_->SetActiveVersion(version1.get());
- VerifyVersionAttributes(
- provider_host1_, version2.get(), NULL, version1.get());
- VerifyVersionAttributes(provider_host2_, NULL, NULL, NULL);
-
- registration_->SetActiveVersion(version2.get());
- VerifyVersionAttributes(provider_host1_, NULL, NULL, version2.get());
- VerifyVersionAttributes(provider_host2_, NULL, NULL, NULL);
-}
-
} // namespace content
« no previous file with comments | « content/browser/service_worker/service_worker_provider_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698