OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 9 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
10 #include "content/browser/service_worker/embedded_worker_instance.h" | 10 #include "content/browser/service_worker/embedded_worker_instance.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 *body = std::string(blob_data_handle->data()->items()[0].bytes(), | 111 *body = std::string(blob_data_handle->data()->items()[0].bytes(), |
112 blob_data_handle->data()->items()[0].length()); | 112 blob_data_handle->data()->items()[0].length()); |
113 } | 113 } |
114 | 114 |
115 } // namespace | 115 } // namespace |
116 | 116 |
117 class ServiceWorkerBrowserTest : public ContentBrowserTest { | 117 class ServiceWorkerBrowserTest : public ContentBrowserTest { |
118 protected: | 118 protected: |
119 typedef ServiceWorkerBrowserTest self; | 119 typedef ServiceWorkerBrowserTest self; |
120 | 120 |
121 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
122 command_line->AppendSwitch(switches::kEnableServiceWorker); | |
123 } | |
124 | |
125 virtual void SetUpOnMainThread() OVERRIDE { | 121 virtual void SetUpOnMainThread() OVERRIDE { |
126 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 122 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
127 StoragePartition* partition = BrowserContext::GetDefaultStoragePartition( | 123 StoragePartition* partition = BrowserContext::GetDefaultStoragePartition( |
128 shell()->web_contents()->GetBrowserContext()); | 124 shell()->web_contents()->GetBrowserContext()); |
129 wrapper_ = static_cast<ServiceWorkerContextWrapper*>( | 125 wrapper_ = static_cast<ServiceWorkerContextWrapper*>( |
130 partition->GetServiceWorkerContext()); | 126 partition->GetServiceWorkerContext()); |
131 | 127 |
132 // Navigate to the page to set up a renderer page (where we can embed | 128 // Navigate to the page to set up a renderer page (where we can embed |
133 // a worker). | 129 // a worker). |
134 NavigateToURLBlockUntilNavigationsComplete( | 130 NavigateToURLBlockUntilNavigationsComplete( |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, | 691 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, |
696 this, | 692 this, |
697 embedded_test_server()->GetURL("/service_worker/empty.html"), | 693 embedded_test_server()->GetURL("/service_worker/empty.html"), |
698 &status, | 694 &status, |
699 &script_url)); | 695 &script_url)); |
700 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); | 696 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); |
701 } | 697 } |
702 } | 698 } |
703 | 699 |
704 } // namespace content | 700 } // namespace content |
OLD | NEW |