| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 *called = true; | 67 *called = true; |
| 68 *out_error = error; | 68 *out_error = error; |
| 69 *out_registration = registration.Clone(); | 69 *out_registration = registration.Clone(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void ErrorAndRegistrationListCallback( | 72 void ErrorAndRegistrationListCallback( |
| 73 bool* called, | 73 bool* called, |
| 74 blink::mojom::BackgroundSyncError* out_error, | 74 blink::mojom::BackgroundSyncError* out_error, |
| 75 unsigned long* out_array_size, | 75 unsigned long* out_array_size, |
| 76 blink::mojom::BackgroundSyncError error, | 76 blink::mojom::BackgroundSyncError error, |
| 77 mojo::Array<blink::mojom::SyncRegistrationPtr> registrations) { | 77 std::vector<blink::mojom::SyncRegistrationPtr> registrations) { |
| 78 *called = true; | 78 *called = true; |
| 79 *out_error = error; | 79 *out_error = error; |
| 80 if (error == blink::mojom::BackgroundSyncError::NONE) | 80 if (error == blink::mojom::BackgroundSyncError::NONE) |
| 81 *out_array_size = registrations.size(); | 81 *out_array_size = registrations.size(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace | 84 } // namespace |
| 85 | 85 |
| 86 class BackgroundSyncServiceImplTest : public testing::Test { | 86 class BackgroundSyncServiceImplTest : public testing::Test { |
| 87 public: | 87 public: |
| (...skipping 168 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 |