| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/public/browser/service_worker_context.h" | 5 #include "content/public/browser/service_worker_context.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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "content/browser/browser_thread_impl.h" | 10 #include "content/browser/browser_thread_impl.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 NULL, | 258 NULL, |
| 259 MakeRegisteredCallback(&called, ®istration_id, &version_id)); | 259 MakeRegisteredCallback(&called, ®istration_id, &version_id)); |
| 260 | 260 |
| 261 ASSERT_FALSE(called); | 261 ASSERT_FALSE(called); |
| 262 base::RunLoop().RunUntilIdle(); | 262 base::RunLoop().RunUntilIdle(); |
| 263 ASSERT_TRUE(called); | 263 ASSERT_TRUE(called); |
| 264 EXPECT_NE(kInvalidServiceWorkerRegistrationId, registration_id); | 264 EXPECT_NE(kInvalidServiceWorkerRegistrationId, registration_id); |
| 265 EXPECT_NE(kInvalidServiceWorkerVersionId, version_id); | 265 EXPECT_NE(kInvalidServiceWorkerVersionId, version_id); |
| 266 | 266 |
| 267 called = false; | 267 called = false; |
| 268 context()->UnregisterServiceWorker( | 268 context()->UnregisterServiceWorker(pattern, |
| 269 pattern, render_process_id_, NULL, MakeUnregisteredCallback(&called)); | 269 MakeUnregisteredCallback(&called)); |
| 270 | 270 |
| 271 ASSERT_FALSE(called); | 271 ASSERT_FALSE(called); |
| 272 base::RunLoop().RunUntilIdle(); | 272 base::RunLoop().RunUntilIdle(); |
| 273 ASSERT_TRUE(called); | 273 ASSERT_TRUE(called); |
| 274 | 274 |
| 275 context()->storage()->FindRegistrationForId( | 275 context()->storage()->FindRegistrationForId( |
| 276 registration_id, | 276 registration_id, |
| 277 base::Bind(&ExpectRegisteredWorkers, | 277 base::Bind(&ExpectRegisteredWorkers, |
| 278 SERVICE_WORKER_ERROR_NOT_FOUND, | 278 SERVICE_WORKER_ERROR_NOT_FOUND, |
| 279 kInvalidServiceWorkerVersionId, | 279 kInvalidServiceWorkerVersionId, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 MakeRegisteredCallback(&called, &new_registration_id, &new_version_id)); | 358 MakeRegisteredCallback(&called, &new_registration_id, &new_version_id)); |
| 359 | 359 |
| 360 ASSERT_FALSE(called); | 360 ASSERT_FALSE(called); |
| 361 base::RunLoop().RunUntilIdle(); | 361 base::RunLoop().RunUntilIdle(); |
| 362 ASSERT_TRUE(called); | 362 ASSERT_TRUE(called); |
| 363 EXPECT_EQ(old_registration_id, new_registration_id); | 363 EXPECT_EQ(old_registration_id, new_registration_id); |
| 364 EXPECT_EQ(old_version_id, new_version_id); | 364 EXPECT_EQ(old_version_id, new_version_id); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace content | 367 } // namespace content |
| OLD | NEW |