| 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 799c36da12d1d0bbdf671f0052480ecae715c148..9ecf53108b0e724a55036da7e5db1729f76e7db9 100644
|
| --- a/content/browser/service_worker/service_worker_provider_host_unittest.cc
|
| +++ b/content/browser/service_worker/service_worker_provider_host_unittest.cc
|
| @@ -14,6 +14,7 @@
|
| #include "content/browser/service_worker/service_worker_registration.h"
|
| #include "content/browser/service_worker/service_worker_test_utils.h"
|
| #include "content/browser/service_worker/service_worker_version.h"
|
| +#include "content/common/url_schemes.h"
|
| #include "content/public/common/origin_util.h"
|
| #include "content/public/test/test_browser_thread_bundle.h"
|
| #include "content/test/test_content_browser_client.h"
|
| @@ -26,8 +27,8 @@ const char kServiceWorkerScheme[] = "i-can-use-service-worker";
|
|
|
| class ServiceWorkerTestContentClient : public TestContentClient {
|
| public:
|
| - void AddServiceWorkerSchemes(std::set<std::string>* schemes) override {
|
| - schemes->insert(kServiceWorkerScheme);
|
| + void AddAdditionalSchemes(Schemes* schemes) override {
|
| + schemes->service_worker_schemes.push_back(kServiceWorkerScheme);
|
| }
|
| };
|
|
|
| @@ -42,6 +43,7 @@ class ServiceWorkerProviderHostTest : public testing::Test {
|
| void SetUp() override {
|
| old_content_browser_client_ =
|
| SetBrowserClientForTesting(&test_content_browser_client_);
|
| + RefreshSecuritySchemesForTesting();
|
|
|
| helper_.reset(new EmbeddedWorkerTestHelper(base::FilePath()));
|
| context_ = helper_->context();
|
| @@ -79,13 +81,15 @@ class ServiceWorkerProviderHostTest : public testing::Test {
|
| registration2_ = 0;
|
| helper_.reset();
|
| SetBrowserClientForTesting(old_content_browser_client_);
|
| + // Reset cached security schemes so we don't affect other tests.
|
| + RefreshSecuritySchemesForTesting();
|
| }
|
|
|
| bool PatternHasProcessToRun(const GURL& pattern) const {
|
| return context_->process_manager()->PatternHasProcessToRun(pattern);
|
| }
|
|
|
| - content::TestBrowserThreadBundle thread_bundle_;
|
| + TestBrowserThreadBundle thread_bundle_;
|
| std::unique_ptr<EmbeddedWorkerTestHelper> helper_;
|
| ServiceWorkerContextCore* context_;
|
| scoped_refptr<ServiceWorkerRegistration> registration1_;
|
| @@ -169,7 +173,6 @@ TEST_F(ServiceWorkerProviderHostTest, MatchRegistration) {
|
|
|
| TEST_F(ServiceWorkerProviderHostTest, ContextSecurity) {
|
| using FrameSecurityLevel = ServiceWorkerProviderHost::FrameSecurityLevel;
|
| - content::ResetSchemesAndOriginsWhitelistForTesting();
|
|
|
| // Insecure document URL.
|
| provider_host1_->SetDocumentUrl(GURL("http://host"));
|
|
|