| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 NULL, | 262 NULL, |
| 263 MakeRegisteredCallback(&called, ®istration_id, &version_id)); | 263 MakeRegisteredCallback(&called, ®istration_id, &version_id)); |
| 264 | 264 |
| 265 ASSERT_FALSE(called); | 265 ASSERT_FALSE(called); |
| 266 base::RunLoop().RunUntilIdle(); | 266 base::RunLoop().RunUntilIdle(); |
| 267 ASSERT_TRUE(called); | 267 ASSERT_TRUE(called); |
| 268 EXPECT_NE(kInvalidServiceWorkerRegistrationId, registration_id); | 268 EXPECT_NE(kInvalidServiceWorkerRegistrationId, registration_id); |
| 269 EXPECT_NE(kInvalidServiceWorkerVersionId, version_id); | 269 EXPECT_NE(kInvalidServiceWorkerVersionId, version_id); |
| 270 | 270 |
| 271 called = false; | 271 called = false; |
| 272 context_->UnregisterServiceWorker( | 272 context_->UnregisterServiceWorker(pattern, MakeUnregisteredCallback(&called)); |
| 273 pattern, render_process_id_, NULL, MakeUnregisteredCallback(&called)); | |
| 274 | 273 |
| 275 ASSERT_FALSE(called); | 274 ASSERT_FALSE(called); |
| 276 base::RunLoop().RunUntilIdle(); | 275 base::RunLoop().RunUntilIdle(); |
| 277 ASSERT_TRUE(called); | 276 ASSERT_TRUE(called); |
| 278 | 277 |
| 279 context_->storage()->FindRegistrationForId( | 278 context_->storage()->FindRegistrationForId( |
| 280 registration_id, | 279 registration_id, |
| 281 base::Bind(&ExpectRegisteredWorkers, | 280 base::Bind(&ExpectRegisteredWorkers, |
| 282 SERVICE_WORKER_ERROR_NOT_FOUND, | 281 SERVICE_WORKER_ERROR_NOT_FOUND, |
| 283 kInvalidServiceWorkerVersionId, | 282 kInvalidServiceWorkerVersionId, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 MakeRegisteredCallback(&called, &new_registration_id, &new_version_id)); | 361 MakeRegisteredCallback(&called, &new_registration_id, &new_version_id)); |
| 363 | 362 |
| 364 ASSERT_FALSE(called); | 363 ASSERT_FALSE(called); |
| 365 base::RunLoop().RunUntilIdle(); | 364 base::RunLoop().RunUntilIdle(); |
| 366 ASSERT_TRUE(called); | 365 ASSERT_TRUE(called); |
| 367 EXPECT_EQ(old_registration_id, new_registration_id); | 366 EXPECT_EQ(old_registration_id, new_registration_id); |
| 368 EXPECT_EQ(old_version_id, new_version_id); | 367 EXPECT_EQ(old_version_id, new_version_id); |
| 369 } | 368 } |
| 370 | 369 |
| 371 } // namespace content | 370 } // namespace content |
| OLD | NEW |