OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/background_sync/background_sync_service_impl.h" | 5 #include "content/browser/background_sync/background_sync_service_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/power_monitor/power_monitor.h" | 10 #include "base/power_monitor/power_monitor.h" |
11 #include "base/power_monitor/power_monitor_source.h" | 11 #include "base/power_monitor/power_monitor_source.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "content/browser/background_sync/background_sync_context_impl.h" | 13 #include "content/browser/background_sync/background_sync_context_impl.h" |
14 #include "content/browser/background_sync/background_sync_network_observer.h" | 14 #include "content/browser/background_sync/background_sync_network_observer.h" |
15 #include "content/browser/service_worker/embedded_worker_test_helper.h" | 15 #include "content/browser/service_worker/embedded_worker_test_helper.h" |
16 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 16 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/test/test_browser_thread_bundle.h" | 18 #include "content/public/test/test_browser_thread_bundle.h" |
19 #include "mojo/public/cpp/bindings/interface_ptr.h" | |
20 #include "net/base/network_change_notifier.h" | 19 #include "net/base/network_change_notifier.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h" |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 const char kServiceWorkerPattern[] = "https://example.com/a"; | 27 const char kServiceWorkerPattern[] = "https://example.com/a"; |
28 const char kServiceWorkerScript[] = "https://example.com/a/script.js"; | 28 const char kServiceWorkerScript[] = "https://example.com/a/script.js"; |
29 const int kProviderId = 1; | 29 const int kProviderId = 1; |
30 | 30 |
31 // Callbacks from SetUp methods | 31 // Callbacks from SetUp methods |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 | 446 |
447 NotifyWhenDone(reg->handle_id, | 447 NotifyWhenDone(reg->handle_id, |
448 base::Bind(&ErrorAndStateCallback, ¬ify_done_called, | 448 base::Bind(&ErrorAndStateCallback, ¬ify_done_called, |
449 ¬ify_done_error, ¬ify_done_sync_state)); | 449 ¬ify_done_error, ¬ify_done_sync_state)); |
450 EXPECT_TRUE(notify_done_called); | 450 EXPECT_TRUE(notify_done_called); |
451 EXPECT_EQ(BACKGROUND_SYNC_ERROR_NONE, notify_done_error); | 451 EXPECT_EQ(BACKGROUND_SYNC_ERROR_NONE, notify_done_error); |
452 EXPECT_EQ(BACKGROUND_SYNC_STATE_UNREGISTERED, notify_done_sync_state); | 452 EXPECT_EQ(BACKGROUND_SYNC_STATE_UNREGISTERED, notify_done_sync_state); |
453 } | 453 } |
454 | 454 |
455 } // namespace content | 455 } // namespace content |
OLD | NEW |