Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: content/browser/background_sync/background_sync_manager_unittest.cc

Issue 1536023002: [BackgroundSync] Add max sync event duration to BackgroundSyncParameters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sync_time2
Patch Set: Rename a constant to match the others Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include <utility> 8 #include <utility>
9 9
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 } 1748 }
1749 1749
1750 TEST_F(BackgroundSyncManagerTest, OverrideParameters) { 1750 TEST_F(BackgroundSyncManagerTest, OverrideParameters) {
1751 BackgroundSyncParameters* parameters = 1751 BackgroundSyncParameters* parameters =
1752 test_controller_->background_sync_parameters(); 1752 test_controller_->background_sync_parameters();
1753 parameters->disable = true; 1753 parameters->disable = true;
1754 parameters->max_sync_attempts = 100; 1754 parameters->max_sync_attempts = 100;
1755 parameters->initial_retry_delay = base::TimeDelta::FromMinutes(200); 1755 parameters->initial_retry_delay = base::TimeDelta::FromMinutes(200);
1756 parameters->retry_delay_factor = 300; 1756 parameters->retry_delay_factor = 300;
1757 parameters->min_sync_recovery_time = base::TimeDelta::FromMinutes(400); 1757 parameters->min_sync_recovery_time = base::TimeDelta::FromMinutes(400);
1758 parameters->max_sync_event_duration = base::TimeDelta::FromMinutes(500);
1758 1759
1759 // Restart the BackgroundSyncManager so that it updates its parameters. 1760 // Restart the BackgroundSyncManager so that it updates its parameters.
1760 SetupBackgroundSyncManager(); 1761 SetupBackgroundSyncManager();
1761 1762
1762 // Check that the manager is disabled 1763 // Check that the manager is disabled
1763 EXPECT_FALSE(Register(sync_options_1_)); 1764 EXPECT_FALSE(Register(sync_options_1_));
1764 EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, callback_status_); 1765 EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, callback_status_);
1765 1766
1766 const BackgroundSyncParameters* manager_parameters = 1767 const BackgroundSyncParameters* manager_parameters =
1767 test_background_sync_manager_->background_sync_parameters(); 1768 test_background_sync_manager_->background_sync_parameters();
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 // Run it again. 2029 // Run it again.
2029 test_clock_->Advance(test_background_sync_manager_->delayed_task_delta()); 2030 test_clock_->Advance(test_background_sync_manager_->delayed_task_delta());
2030 test_background_sync_manager_->delayed_task().Run(); 2031 test_background_sync_manager_->delayed_task().Run();
2031 base::RunLoop().RunUntilIdle(); 2032 base::RunLoop().RunUntilIdle();
2032 EXPECT_FALSE(GetRegistration(sync_options_1_)); 2033 EXPECT_FALSE(GetRegistration(sync_options_1_));
2033 EXPECT_EQ(BACKGROUND_SYNC_EVENT_LAST_CHANCE_IS_LAST_CHANCE, 2034 EXPECT_EQ(BACKGROUND_SYNC_EVENT_LAST_CHANCE_IS_LAST_CHANCE,
2034 test_background_sync_manager_->last_chance()); 2035 test_background_sync_manager_->last_chance());
2035 } 2036 }
2036 2037
2037 } // namespace content 2038 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/background_sync/background_sync_manager.cc ('k') | content/public/browser/background_sync_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698