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

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

Issue 1192013003: [Extension ServiceWorkers] Allow service worker registration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments to test Created 5 years, 5 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_request_handler.cc ('k') | content/common/origin_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_request_handler_unittest.cc
diff --git a/content/browser/service_worker/service_worker_request_handler_unittest.cc b/content/browser/service_worker/service_worker_request_handler_unittest.cc
index 4d12e994a37d10057ef975b70c7b13cee7d09987..7cbb8108e1e031bc97054e1566c4193c2ca77b9e 100644
--- a/content/browser/service_worker/service_worker_request_handler_unittest.cc
+++ b/content/browser/service_worker/service_worker_request_handler_unittest.cc
@@ -118,23 +118,23 @@ class ServiceWorkerRequestHandlerTest : public testing::Test {
};
TEST_F(ServiceWorkerRequestHandlerTest, InitializeHandler) {
- EXPECT_TRUE(InitializeHandlerCheck(
- "http://host/scope/doc", "GET", false, RESOURCE_TYPE_MAIN_FRAME));
- EXPECT_TRUE(InitializeHandlerCheck(
- "https://host/scope/doc", "GET", false, RESOURCE_TYPE_MAIN_FRAME));
+ // Cannot initialize a handler for non-secure origins.
+ EXPECT_FALSE(InitializeHandlerCheck("http://host/scope/doc", "GET", false,
+ RESOURCE_TYPE_MAIN_FRAME));
EXPECT_FALSE(InitializeHandlerCheck(
"ftp://host/scope/doc", "GET", false, RESOURCE_TYPE_MAIN_FRAME));
+ EXPECT_TRUE(InitializeHandlerCheck("https://host/scope/doc", "GET", false,
+ RESOURCE_TYPE_MAIN_FRAME));
- EXPECT_TRUE(InitializeHandlerCheck(
- "http://host/scope/doc", "OPTIONS", false, RESOURCE_TYPE_MAIN_FRAME));
+ // OPTIONS is also supported. See crbug.com/434660.
EXPECT_TRUE(InitializeHandlerCheck(
"https://host/scope/doc", "OPTIONS", false, RESOURCE_TYPE_MAIN_FRAME));
provider_host_->SetDocumentUrl(GURL(""));
EXPECT_FALSE(InitializeHandlerCheck(
"http://host/scope/doc", "GET", true, RESOURCE_TYPE_MAIN_FRAME));
- EXPECT_STREQ("http://host/scope/doc",
- provider_host_->document_url().spec().c_str());
+ // Cannot initialize a handler for non-secure origins.
+ EXPECT_STREQ("", provider_host_->document_url().spec().c_str());
EXPECT_FALSE(InitializeHandlerCheck(
"https://host/scope/doc", "GET", true, RESOURCE_TYPE_MAIN_FRAME));
EXPECT_STREQ("https://host/scope/doc",
@@ -143,8 +143,8 @@ TEST_F(ServiceWorkerRequestHandlerTest, InitializeHandler) {
provider_host_->SetDocumentUrl(GURL(""));
EXPECT_FALSE(InitializeHandlerCheck(
"http://host/scope/doc", "GET", true, RESOURCE_TYPE_SUB_FRAME));
- EXPECT_STREQ("http://host/scope/doc",
- provider_host_->document_url().spec().c_str());
+ // Cannot initialize a handler for non-secure origins.
+ EXPECT_STREQ("", provider_host_->document_url().spec().c_str());
EXPECT_FALSE(InitializeHandlerCheck(
"https://host/scope/doc", "GET", true, RESOURCE_TYPE_SUB_FRAME));
EXPECT_STREQ("https://host/scope/doc",
« no previous file with comments | « content/browser/service_worker/service_worker_request_handler.cc ('k') | content/common/origin_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698