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 #include <tuple> | 6 #include <tuple> |
7 | 7 |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 EXPECT_FALSE(called); | 179 EXPECT_FALSE(called); |
180 base::RunLoop().RunUntilIdle(); | 180 base::RunLoop().RunUntilIdle(); |
181 EXPECT_TRUE(called); | 181 EXPECT_TRUE(called); |
182 return registration; | 182 return registration; |
183 } | 183 } |
184 | 184 |
185 std::unique_ptr<ServiceWorkerProviderHost> | 185 std::unique_ptr<ServiceWorkerProviderHost> |
186 ServiceWorkerJobTest::CreateControllee() { | 186 ServiceWorkerJobTest::CreateControllee() { |
187 return std::unique_ptr<ServiceWorkerProviderHost>( | 187 return std::unique_ptr<ServiceWorkerProviderHost>( |
188 new ServiceWorkerProviderHost(33 /* dummy render_process id */, | 188 new ServiceWorkerProviderHost( |
189 MSG_ROUTING_NONE /* render_frame_id */, | 189 33 /* dummy render_process id */, |
190 1 /* dummy provider_id */, | 190 MSG_ROUTING_NONE /* render_frame_id */, 1 /* dummy provider_id */, |
191 SERVICE_WORKER_PROVIDER_FOR_WINDOW, | 191 SERVICE_WORKER_PROVIDER_FOR_WINDOW, |
192 helper_->context()->AsWeakPtr(), NULL)); | 192 ServiceWorkerProviderHost::FrameSecurityLevel::SECURE, |
| 193 helper_->context()->AsWeakPtr(), NULL)); |
193 } | 194 } |
194 | 195 |
195 TEST_F(ServiceWorkerJobTest, SameDocumentSameRegistration) { | 196 TEST_F(ServiceWorkerJobTest, SameDocumentSameRegistration) { |
196 scoped_refptr<ServiceWorkerRegistration> original_registration = | 197 scoped_refptr<ServiceWorkerRegistration> original_registration = |
197 RunRegisterJob(GURL("http://www.example.com/"), | 198 RunRegisterJob(GURL("http://www.example.com/"), |
198 GURL("http://www.example.com/service_worker.js")); | 199 GURL("http://www.example.com/service_worker.js")); |
199 bool called; | 200 bool called; |
200 scoped_refptr<ServiceWorkerRegistration> registration1; | 201 scoped_refptr<ServiceWorkerRegistration> registration1; |
201 storage()->FindRegistrationForDocument( | 202 storage()->FindRegistrationForDocument( |
202 GURL("http://www.example.com/"), | 203 GURL("http://www.example.com/"), |
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1688 // should not be promoted to ACTIVATED because failure occur | 1689 // should not be promoted to ACTIVATED because failure occur |
1689 // during shutdown. | 1690 // during shutdown. |
1690 runner->RunUntilIdle(); | 1691 runner->RunUntilIdle(); |
1691 base::RunLoop().RunUntilIdle(); | 1692 base::RunLoop().RunUntilIdle(); |
1692 EXPECT_EQ(new_version.get(), registration->active_version()); | 1693 EXPECT_EQ(new_version.get(), registration->active_version()); |
1693 EXPECT_EQ(ServiceWorkerVersion::ACTIVATING, new_version->status()); | 1694 EXPECT_EQ(ServiceWorkerVersion::ACTIVATING, new_version->status()); |
1694 registration->RemoveListener(update_helper); | 1695 registration->RemoveListener(update_helper); |
1695 } | 1696 } |
1696 | 1697 |
1697 } // namespace content | 1698 } // namespace content |
OLD | NEW |