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_manager.h" | 5 #include "content/browser/background_sync/background_sync_manager.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 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 | 1300 |
1301 EXPECT_FALSE(GetRegistration(sync_options_1_)); | 1301 EXPECT_FALSE(GetRegistration(sync_options_1_)); |
1302 EXPECT_FALSE(GetRegistration(sync_options_2_)); | 1302 EXPECT_FALSE(GetRegistration(sync_options_2_)); |
1303 } | 1303 } |
1304 | 1304 |
1305 TEST_F(BackgroundSyncManagerTest, LastChance) { | 1305 TEST_F(BackgroundSyncManagerTest, LastChance) { |
1306 SetMaxSyncAttemptsAndRestartManager(2); | 1306 SetMaxSyncAttemptsAndRestartManager(2); |
1307 InitFailedSyncEventTest(); | 1307 InitFailedSyncEventTest(); |
1308 | 1308 |
1309 EXPECT_TRUE(Register(sync_options_1_)); | 1309 EXPECT_TRUE(Register(sync_options_1_)); |
1310 EXPECT_EQ(mojom::BackgroundSyncEventLastChance::IS_NOT_LAST_CHANCE, | 1310 EXPECT_EQ(blink::mojom::BackgroundSyncEventLastChance::IS_NOT_LAST_CHANCE, |
1311 test_background_sync_manager_->last_chance()); | 1311 test_background_sync_manager_->last_chance()); |
1312 EXPECT_TRUE(GetRegistration(sync_options_1_)); | 1312 EXPECT_TRUE(GetRegistration(sync_options_1_)); |
1313 | 1313 |
1314 // Run it again. | 1314 // Run it again. |
1315 test_clock_->Advance(test_background_sync_manager_->delayed_task_delta()); | 1315 test_clock_->Advance(test_background_sync_manager_->delayed_task_delta()); |
1316 test_background_sync_manager_->delayed_task().Run(); | 1316 test_background_sync_manager_->delayed_task().Run(); |
1317 base::RunLoop().RunUntilIdle(); | 1317 base::RunLoop().RunUntilIdle(); |
1318 EXPECT_FALSE(GetRegistration(sync_options_1_)); | 1318 EXPECT_FALSE(GetRegistration(sync_options_1_)); |
1319 EXPECT_EQ(mojom::BackgroundSyncEventLastChance::IS_LAST_CHANCE, | 1319 EXPECT_EQ(blink::mojom::BackgroundSyncEventLastChance::IS_LAST_CHANCE, |
1320 test_background_sync_manager_->last_chance()); | 1320 test_background_sync_manager_->last_chance()); |
1321 } | 1321 } |
1322 | 1322 |
1323 } // namespace content | 1323 } // namespace content |
OLD | NEW |