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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 sw_registration_id_, GURL(kServiceWorkerPattern).GetOrigin(), | 172 sw_registration_id_, GURL(kServiceWorkerPattern).GetOrigin(), |
173 base::Bind(FindServiceWorkerRegistrationCallback, &sw_registration_)); | 173 base::Bind(FindServiceWorkerRegistrationCallback, &sw_registration_)); |
174 base::RunLoop().RunUntilIdle(); | 174 base::RunLoop().RunUntilIdle(); |
175 EXPECT_TRUE(sw_registration_); | 175 EXPECT_TRUE(sw_registration_); |
176 } | 176 } |
177 | 177 |
178 void CreateBackgroundSyncServiceImpl() { | 178 void CreateBackgroundSyncServiceImpl() { |
179 // Create a dummy mojo channel so that the BackgroundSyncServiceImpl can be | 179 // Create a dummy mojo channel so that the BackgroundSyncServiceImpl can be |
180 // instantiated. | 180 // instantiated. |
181 mojo::InterfaceRequest<blink::mojom::BackgroundSyncService> | 181 mojo::InterfaceRequest<blink::mojom::BackgroundSyncService> |
182 service_request = mojo::GetProxy(&service_ptr_); | 182 service_request = mojo::MakeRequest(&service_ptr_); |
183 // Create a new BackgroundSyncServiceImpl bound to the dummy channel. | 183 // Create a new BackgroundSyncServiceImpl bound to the dummy channel. |
184 background_sync_context_->CreateService(std::move(service_request)); | 184 background_sync_context_->CreateService(std::move(service_request)); |
185 base::RunLoop().RunUntilIdle(); | 185 base::RunLoop().RunUntilIdle(); |
186 | 186 |
187 service_impl_ = background_sync_context_->services_.begin()->first; | 187 service_impl_ = background_sync_context_->services_.begin()->first; |
188 ASSERT_TRUE(service_impl_); | 188 ASSERT_TRUE(service_impl_); |
189 } | 189 } |
190 | 190 |
191 // Helpers for testing BackgroundSyncServiceImpl methods | 191 // Helpers for testing BackgroundSyncServiceImpl methods |
192 void Register( | 192 void Register( |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, register_error); | 254 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, register_error); |
255 GetRegistrations(base::Bind(&ErrorAndRegistrationListCallback, | 255 GetRegistrations(base::Bind(&ErrorAndRegistrationListCallback, |
256 &getregistrations_called, &getregistrations_error, | 256 &getregistrations_called, &getregistrations_error, |
257 &array_size)); | 257 &array_size)); |
258 EXPECT_TRUE(getregistrations_called); | 258 EXPECT_TRUE(getregistrations_called); |
259 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, getregistrations_error); | 259 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, getregistrations_error); |
260 EXPECT_EQ(1UL, array_size); | 260 EXPECT_EQ(1UL, array_size); |
261 } | 261 } |
262 | 262 |
263 } // namespace content | 263 } // namespace content |
OLD | NEW |