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

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

Issue 2653493009: Add two interfaces for ServiceWorkerProviderContext/ProviderHost (Closed)
Patch Set: Addressed comments from falken Created 3 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: content/browser/service_worker/link_header_support_unittest.cc
diff --git a/content/browser/service_worker/link_header_support_unittest.cc b/content/browser/service_worker/link_header_support_unittest.cc
index ad8e2cd1941efa498502f6ecf297b5d35d8e09b0..d589fea8ff23d9ddfa0e348f1704a75a6cc2ad94 100644
--- a/content/browser/service_worker/link_header_support_unittest.cc
+++ b/content/browser/service_worker/link_header_support_unittest.cc
@@ -79,10 +79,12 @@ class LinkHeaderServiceWorkerTest : public ::testing::Test {
void CreateDocumentProviderHost() {
// An empty host.
+ remote_endpoints_.emplace_back();
std::unique_ptr<ServiceWorkerProviderHost> host =
CreateProviderHostForWindow(render_process_id(), kMockProviderId,
true /* is_parent_frame_secure */,
- context()->AsWeakPtr());
+ context()->AsWeakPtr(),
+ &remote_endpoints_.back());
provider_host_ = host->AsWeakPtr();
EXPECT_FALSE(
context()->GetProviderHost(host->process_id(), host->provider_id()));
@@ -91,10 +93,12 @@ class LinkHeaderServiceWorkerTest : public ::testing::Test {
void CreateInsecureDocumentProviderHost() {
// An empty host.
+ remote_endpoints_.emplace_back();
std::unique_ptr<ServiceWorkerProviderHost> host =
CreateProviderHostForWindow(render_process_id(), kMockProviderId,
false /* is_parent_frame_secure */,
- context()->AsWeakPtr());
+ context()->AsWeakPtr(),
+ &remote_endpoints_.back());
provider_host_ = host->AsWeakPtr();
EXPECT_FALSE(
context()->GetProviderHost(host->process_id(), host->provider_id()));
@@ -102,10 +106,12 @@ class LinkHeaderServiceWorkerTest : public ::testing::Test {
}
void CreateServiceWorkerProviderHost() {
+ remote_endpoints_.emplace_back();
std::unique_ptr<ServiceWorkerProviderHost> host =
CreateProviderHostForServiceWorkerContext(
render_process_id(), kMockProviderId,
- true /* is_parent_frame_secure */, context()->AsWeakPtr());
+ true /* is_parent_frame_secure */, context()->AsWeakPtr(),
+ &remote_endpoints_.back());
provider_host_ = host->AsWeakPtr();
EXPECT_FALSE(
context()->GetProviderHost(host->process_id(), host->provider_id()));
@@ -161,7 +167,7 @@ class LinkHeaderServiceWorkerTest : public ::testing::Test {
return registrations;
}
- private:
+ protected:
TestBrowserThreadBundle thread_bundle_;
std::unique_ptr<EmbeddedWorkerTestHelper> helper_;
net::TestURLRequestContext request_context_;
@@ -169,6 +175,7 @@ class LinkHeaderServiceWorkerTest : public ::testing::Test {
MockResourceContext resource_context_;
base::WeakPtr<ServiceWorkerProviderHost> provider_host_;
storage::BlobStorageContext blob_storage_context_;
+ std::vector<ServiceWorkerRemoteProviderEndpoint> remote_endpoints_;
};
TEST_F(LinkHeaderServiceWorkerTest, InstallServiceWorker_Basic) {
@@ -397,10 +404,12 @@ TEST_F(LinkHeaderServiceWorkerTest,
InstallServiceWorker_FromWorkerWithControllees) {
CreateServiceWorkerProviderHost();
+ remote_endpoints_.emplace_back();
std::unique_ptr<ServiceWorkerProviderHost> controllee =
CreateProviderHostForWindow(render_process_id(), kMockProviderId,
true /* is_parent_frame_secure */,
- context()->AsWeakPtr());
+ context()->AsWeakPtr(),
+ &remote_endpoints_.back());
provider_host()->running_hosted_version()->AddControllee(controllee.get());
ProcessLinkHeaderForRequest(

Powered by Google App Engine
This is Rietveld 408576698