| 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 11 matching lines...) Expand all Loading... |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 void SaveResponseCallback(bool* called, | 26 void SaveResponseCallback(bool* called, |
| 27 int64* store_registration_id, | 27 int64* store_registration_id, |
| 28 int64* store_version_id, | 28 int64* store_version_id, |
| 29 ServiceWorkerStatusCode status, | 29 ServiceWorkerStatusCode status, |
| 30 int64 registration_id, | 30 int64 registration_id, |
| 31 int64 version_id) { | 31 int64 version_id) { |
| 32 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); |
| 32 *called = true; | 33 *called = true; |
| 33 *store_registration_id = registration_id; | 34 *store_registration_id = registration_id; |
| 34 *store_version_id = version_id; | 35 *store_version_id = version_id; |
| 35 } | 36 } |
| 36 | 37 |
| 37 ServiceWorkerContextCore::RegistrationCallback MakeRegisteredCallback( | 38 ServiceWorkerContextCore::RegistrationCallback MakeRegisteredCallback( |
| 38 bool* called, | 39 bool* called, |
| 39 int64* store_registration_id, | 40 int64* store_registration_id, |
| 40 int64* store_version_id) { | 41 int64* store_version_id) { |
| 41 return base::Bind(&SaveResponseCallback, called, | 42 return base::Bind(&SaveResponseCallback, called, |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 MakeRegisteredCallback(&called, &new_registration_id, &new_version_id)); | 376 MakeRegisteredCallback(&called, &new_registration_id, &new_version_id)); |
| 376 | 377 |
| 377 ASSERT_FALSE(called); | 378 ASSERT_FALSE(called); |
| 378 base::RunLoop().RunUntilIdle(); | 379 base::RunLoop().RunUntilIdle(); |
| 379 ASSERT_TRUE(called); | 380 ASSERT_TRUE(called); |
| 380 EXPECT_EQ(old_registration_id, new_registration_id); | 381 EXPECT_EQ(old_registration_id, new_registration_id); |
| 381 EXPECT_EQ(old_version_id, new_version_id); | 382 EXPECT_EQ(old_version_id, new_version_id); |
| 382 } | 383 } |
| 383 | 384 |
| 384 } // namespace content | 385 } // namespace content |
| OLD | NEW |