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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 } | 84 } |
85 ADD_FAILURE() << "Registration should exist"; | 85 ADD_FAILURE() << "Registration should exist"; |
86 } | 86 } |
87 | 87 |
88 void RegistrationPendingDidGetSWRegistration( | 88 void RegistrationPendingDidGetSWRegistration( |
89 const scoped_refptr<BackgroundSyncContext> sync_context, | 89 const scoped_refptr<BackgroundSyncContext> sync_context, |
90 const std::string& tag, | 90 const std::string& tag, |
91 const base::Callback<void(bool)>& callback, | 91 const base::Callback<void(bool)>& callback, |
92 ServiceWorkerStatusCode status, | 92 ServiceWorkerStatusCode status, |
93 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 93 scoped_refptr<ServiceWorkerRegistration> registration) { |
94 ASSERT_EQ(SERVICE_WORKER_OK, status); | 94 ASSERT_EQ(SERVICE_WORKER_OK, status); |
95 int64_t service_worker_id = registration->id(); | 95 int64_t service_worker_id = registration->id(); |
96 BackgroundSyncManager* sync_manager = sync_context->background_sync_manager(); | 96 BackgroundSyncManager* sync_manager = sync_context->background_sync_manager(); |
97 sync_manager->GetRegistrations( | 97 sync_manager->GetRegistrations( |
98 service_worker_id, | 98 service_worker_id, |
99 base::Bind(&RegistrationPendingDidGetSyncRegistration, tag, callback)); | 99 base::Bind(&RegistrationPendingDidGetSyncRegistration, tag, callback)); |
100 } | 100 } |
101 | 101 |
102 void RegistrationPendingOnIOThread( | 102 void RegistrationPendingOnIOThread( |
103 const scoped_refptr<BackgroundSyncContext> sync_context, | 103 const scoped_refptr<BackgroundSyncContext> sync_context, |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 IN_PROC_BROWSER_TEST_F(BackgroundSyncBrowserTest, | 680 IN_PROC_BROWSER_TEST_F(BackgroundSyncBrowserTest, |
681 RegisterFromServiceWorkerWithoutMainFrameHost) { | 681 RegisterFromServiceWorkerWithoutMainFrameHost) { |
682 std::string script_result; | 682 std::string script_result; |
683 EXPECT_TRUE( | 683 EXPECT_TRUE( |
684 RegisterFromCrossOriginFrame(kRegisterSyncFromSWURL, &script_result)); | 684 RegisterFromCrossOriginFrame(kRegisterSyncFromSWURL, &script_result)); |
685 EXPECT_EQ(BuildExpectedResult("frame", "failed to register sync"), | 685 EXPECT_EQ(BuildExpectedResult("frame", "failed to register sync"), |
686 script_result); | 686 script_result); |
687 } | 687 } |
688 | 688 |
689 } // namespace content | 689 } // namespace content |
OLD | NEW |