| 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 10 matching lines...) Expand all Loading... |
| 21 #include "content/public/test/test_utils.h" | 21 #include "content/public/test/test_utils.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 void SaveResponseCallback(bool* called, | 28 void SaveResponseCallback(bool* called, |
| 29 int64* store_registration_id, | 29 int64* store_registration_id, |
| 30 ServiceWorkerStatusCode status, | 30 ServiceWorkerStatusCode status, |
| 31 const std::string& status_message, |
| 31 int64 registration_id) { | 32 int64 registration_id) { |
| 32 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); | 33 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); |
| 33 *called = true; | 34 *called = true; |
| 34 *store_registration_id = registration_id; | 35 *store_registration_id = registration_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 return base::Bind(&SaveResponseCallback, called, store_registration_id); | 41 return base::Bind(&SaveResponseCallback, called, store_registration_id); |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 | 587 |
| 587 ASSERT_EQ(3u, notifications_.size()); | 588 ASSERT_EQ(3u, notifications_.size()); |
| 588 EXPECT_EQ(REGISTRATION_STORED, notifications_[0].type); | 589 EXPECT_EQ(REGISTRATION_STORED, notifications_[0].type); |
| 589 EXPECT_EQ(pattern, notifications_[0].pattern); | 590 EXPECT_EQ(pattern, notifications_[0].pattern); |
| 590 EXPECT_EQ(STORAGE_RECOVERED, notifications_[1].type); | 591 EXPECT_EQ(STORAGE_RECOVERED, notifications_[1].type); |
| 591 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); | 592 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); |
| 592 EXPECT_EQ(pattern, notifications_[2].pattern); | 593 EXPECT_EQ(pattern, notifications_[2].pattern); |
| 593 } | 594 } |
| 594 | 595 |
| 595 } // namespace content | 596 } // namespace content |
| OLD | NEW |