Chromium Code Reviews| Index: content/browser/service_worker/service_worker_dispatcher_host_unittest.cc |
| diff --git a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc |
| index 462d093bae277e4b025794237f480e329178cbfa..612649a4fc0f2f58552ce481778aaa1eceb0825f 100644 |
| --- a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc |
| +++ b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc |
| @@ -339,6 +339,38 @@ TEST_F(ServiceWorkerDispatcherHostTest, |
| const int64 kProviderId = 99; // Dummy value |
| scoped_ptr<ServiceWorkerProviderHost> host( |
| CreateServiceWorkerProviderHost(kProviderId)); |
| + host->SetDocumentUrl(GURL("https://www.example.com/")); |
| + context()->AddProviderHost(host.Pass()); |
| + |
| + SendRegister(kProviderId, GURL("https://www.example.com/%2f"), |
| + GURL("https://www.example.com/")); |
| + EXPECT_EQ(1, dispatcher_host_->bad_messages_received_count_); |
| + |
| + SendRegister(kProviderId, GURL("https://www.example.com/%2F"), |
| + GURL("https://www.example.com/")); |
| + EXPECT_EQ(2, dispatcher_host_->bad_messages_received_count_); |
| + |
| + SendRegister(kProviderId, GURL("https://www.example.com/"), |
| + GURL("https://www.example.com/%2f")); |
| + EXPECT_EQ(3, dispatcher_host_->bad_messages_received_count_); |
| + |
| + SendRegister(kProviderId, GURL("https://www.example.com/%5c"), |
| + GURL("https://www.example.com/")); |
| + EXPECT_EQ(4, dispatcher_host_->bad_messages_received_count_); |
| + |
| + SendRegister(kProviderId, GURL("https://www.example.com/"), |
| + GURL("https://www.example.com/%5c")); |
| + EXPECT_EQ(5, dispatcher_host_->bad_messages_received_count_); |
| + |
| + SendRegister(kProviderId, GURL("https://www.example.com/"), |
| + GURL("https://www.example.com/%5C")); |
| + EXPECT_EQ(6, dispatcher_host_->bad_messages_received_count_); |
| +} |
| + |
| +TEST_F(ServiceWorkerDispatcherHostTest, RegisterWithBadCharactersShouldFail) { |
|
falken
2015/08/05 06:55:35
These test names look reversed.
jeremyarcher
2015/08/10 03:29:40
Whoops! Had to stare at it for a second; PTAL.
nhiroki
2015/08/10 08:03:17
I cannot see the updated patchset. Maybe you faile
|
| + const int64 kProviderId = 99; // Dummy value |
| + scoped_ptr<ServiceWorkerProviderHost> host( |
| + CreateServiceWorkerProviderHost(kProviderId)); |
| host->SetDocumentUrl(GURL("https://www.example.com/temporary/")); |
| context()->AddProviderHost(host.Pass()); |