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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 const std::string& status_message, | 44 const std::string& status_message, |
45 int64_t registration_id) { | 45 int64_t registration_id) { |
46 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); | 46 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); |
47 *called = true; | 47 *called = true; |
48 *store_registration_id = registration_id; | 48 *store_registration_id = registration_id; |
49 } | 49 } |
50 | 50 |
51 void FindServiceWorkerRegistrationCallback( | 51 void FindServiceWorkerRegistrationCallback( |
52 scoped_refptr<ServiceWorkerRegistration>* out_registration, | 52 scoped_refptr<ServiceWorkerRegistration>* out_registration, |
53 ServiceWorkerStatusCode status, | 53 ServiceWorkerStatusCode status, |
54 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 54 scoped_refptr<ServiceWorkerRegistration> registration) { |
55 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); | 55 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); |
56 *out_registration = registration; | 56 *out_registration = registration; |
nhiroki
2016/07/25 09:15:40
std::move
horo
2016/07/25 09:32:01
Done.
| |
57 } | 57 } |
58 | 58 |
59 // Callbacks from BackgroundSyncServiceImpl methods | 59 // Callbacks from BackgroundSyncServiceImpl methods |
60 | 60 |
61 void ErrorAndRegistrationCallback( | 61 void ErrorAndRegistrationCallback( |
62 bool* called, | 62 bool* called, |
63 blink::mojom::BackgroundSyncError* out_error, | 63 blink::mojom::BackgroundSyncError* out_error, |
64 blink::mojom::SyncRegistrationPtr* out_registration, | 64 blink::mojom::SyncRegistrationPtr* out_registration, |
65 blink::mojom::BackgroundSyncError error, | 65 blink::mojom::BackgroundSyncError error, |
66 blink::mojom::SyncRegistrationPtr registration) { | 66 blink::mojom::SyncRegistrationPtr registration) { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, register_error); | 256 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, register_error); |
257 GetRegistrations(base::Bind(&ErrorAndRegistrationListCallback, | 257 GetRegistrations(base::Bind(&ErrorAndRegistrationListCallback, |
258 &getregistrations_called, &getregistrations_error, | 258 &getregistrations_called, &getregistrations_error, |
259 &array_size)); | 259 &array_size)); |
260 EXPECT_TRUE(getregistrations_called); | 260 EXPECT_TRUE(getregistrations_called); |
261 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, getregistrations_error); | 261 EXPECT_EQ(blink::mojom::BackgroundSyncError::NONE, getregistrations_error); |
262 EXPECT_EQ(1UL, array_size); | 262 EXPECT_EQ(1UL, array_size); |
263 } | 263 } |
264 | 264 |
265 } // namespace content | 265 } // namespace content |
OLD | NEW |