Chromium Code Reviews| Index: Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp |
| diff --git a/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp b/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp |
| index 04f0433e8f460e28853f1c22e537e34a4b78bfb9..2f91bb83133f779c6ca0dd70b310dd8cbfaef8b2 100644 |
| --- a/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp |
| +++ b/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp |
| @@ -228,6 +228,15 @@ TEST_F(ServiceWorkerContainerTest, Register_CrossOriginScopeIsRejected) |
| ExpectDOMException("SecurityError", "The scope must match the current origin.")); |
| } |
| +TEST_F(ServiceWorkerContainerTest, Register_DiffentDirectryThanScript) |
|
falken
2014/10/24 07:30:36
spelling: Different and Directory
horo
2014/10/24 07:46:37
Done.
|
| +{ |
| + setPageURL("https://www.example.com/"); |
| + testRegisterRejected( |
| + "https://www.example.com/js/worker.js", |
| + "https://www.example.com/", |
| + ExpectDOMException("SecurityError", "The scope must be under the directory of the script URL.")); |
| +} |
| + |
| TEST_F(ServiceWorkerContainerTest, GetRegistration_NonSecureOriginIsRejected) |
| { |
| setPageURL("http://www.example.com/"); |
| @@ -320,11 +329,11 @@ TEST_F(ServiceWorkerContainerTest, RegisterUnregister_NonHttpsSecureOriginDelega |
| ScriptState::Scope scriptScope(scriptState()); |
| RegistrationOptions options; |
| options.setScope("y/"); |
| - container->registerServiceWorker(scriptState(), "/z/worker.js", options); |
| + container->registerServiceWorker(scriptState(), "/x/y/worker.js", options); |
| EXPECT_EQ(1ul, stubProvider.registerCallCount()); |
| EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/y/")), stubProvider.registerScope()); |
| - EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/z/worker.js")), stubProvider.registerScriptURL()); |
| + EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/y/worker.js")), stubProvider.registerScriptURL()); |
| } |
| container->willBeDetachedFromFrame(); |