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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 EXPECT_FALSE(called); | 175 EXPECT_FALSE(called); |
176 base::RunLoop().RunUntilIdle(); | 176 base::RunLoop().RunUntilIdle(); |
177 EXPECT_TRUE(called); | 177 EXPECT_TRUE(called); |
178 return registration; | 178 return registration; |
179 } | 179 } |
180 | 180 |
181 std::unique_ptr<ServiceWorkerProviderHost> | 181 std::unique_ptr<ServiceWorkerProviderHost> |
182 ServiceWorkerJobTest::CreateControllee() { | 182 ServiceWorkerJobTest::CreateControllee() { |
183 return std::unique_ptr<ServiceWorkerProviderHost>( | 183 return std::unique_ptr<ServiceWorkerProviderHost>( |
184 new ServiceWorkerProviderHost(33 /* dummy render_process id */, | 184 new ServiceWorkerProviderHost( |
185 MSG_ROUTING_NONE /* render_frame_id */, | 185 33 /* dummy render_process id */, |
186 1 /* dummy provider_id */, | 186 MSG_ROUTING_NONE /* render_frame_id */, 1 /* dummy provider_id */, |
187 SERVICE_WORKER_PROVIDER_FOR_WINDOW, | 187 SERVICE_WORKER_PROVIDER_FOR_WINDOW, true /* is_parent_frame_secure */, |
188 helper_->context()->AsWeakPtr(), NULL)); | 188 helper_->context()->AsWeakPtr(), NULL)); |
189 } | 189 } |
190 | 190 |
191 TEST_F(ServiceWorkerJobTest, SameDocumentSameRegistration) { | 191 TEST_F(ServiceWorkerJobTest, SameDocumentSameRegistration) { |
192 scoped_refptr<ServiceWorkerRegistration> original_registration = | 192 scoped_refptr<ServiceWorkerRegistration> original_registration = |
193 RunRegisterJob(GURL("http://www.example.com/"), | 193 RunRegisterJob(GURL("http://www.example.com/"), |
194 GURL("http://www.example.com/service_worker.js")); | 194 GURL("http://www.example.com/service_worker.js")); |
195 bool called; | 195 bool called; |
196 scoped_refptr<ServiceWorkerRegistration> registration1; | 196 scoped_refptr<ServiceWorkerRegistration> registration1; |
197 storage()->FindRegistrationForDocument( | 197 storage()->FindRegistrationForDocument( |
198 GURL("http://www.example.com/"), | 198 GURL("http://www.example.com/"), |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 ASSERT_TRUE(start_msg); | 1606 ASSERT_TRUE(start_msg); |
1607 EmbeddedWorkerMsg_StartWorker::Param param; | 1607 EmbeddedWorkerMsg_StartWorker::Param param; |
1608 EmbeddedWorkerMsg_StartWorker::Read(start_msg, ¶m); | 1608 EmbeddedWorkerMsg_StartWorker::Read(start_msg, ¶m); |
1609 EmbeddedWorkerMsg_StartWorker_Params start_params = base::get<0>(param); | 1609 EmbeddedWorkerMsg_StartWorker_Params start_params = base::get<0>(param); |
1610 EXPECT_TRUE(start_params.pause_after_download); | 1610 EXPECT_TRUE(start_params.pause_after_download); |
1611 sink->ClearMessages(); | 1611 sink->ClearMessages(); |
1612 } | 1612 } |
1613 } | 1613 } |
1614 | 1614 |
1615 } // namespace content | 1615 } // namespace content |
OLD | NEW |