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

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

Issue 2592793002: Revert of Change how the quota system computes the total poolsize for temporary storage (Closed)
Patch Set: Created 4 years 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 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 new testing::NiceMock<MockPermissionManager>()); 129 new testing::NiceMock<MockPermissionManager>());
130 ON_CALL(*mock_permission_manager, 130 ON_CALL(*mock_permission_manager,
131 GetPermissionStatus(PermissionType::BACKGROUND_SYNC, _, _)) 131 GetPermissionStatus(PermissionType::BACKGROUND_SYNC, _, _))
132 .WillByDefault(Return(blink::mojom::PermissionStatus::GRANTED)); 132 .WillByDefault(Return(blink::mojom::PermissionStatus::GRANTED));
133 helper_->browser_context()->SetPermissionManager( 133 helper_->browser_context()->SetPermissionManager(
134 std::move(mock_permission_manager)); 134 std::move(mock_permission_manager));
135 135
136 // Create a StoragePartition with the correct BrowserContext so that the 136 // Create a StoragePartition with the correct BrowserContext so that the
137 // BackgroundSyncManager can find the BrowserContext through it. 137 // BackgroundSyncManager can find the BrowserContext through it.
138 storage_partition_impl_.reset(new StoragePartitionImpl( 138 storage_partition_impl_.reset(new StoragePartitionImpl(
139 helper_->browser_context(), base::FilePath(), nullptr)); 139 helper_->browser_context(), base::FilePath(), nullptr, nullptr, nullptr,
140 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
141 nullptr, nullptr, nullptr));
140 helper_->context_wrapper()->set_storage_partition( 142 helper_->context_wrapper()->set_storage_partition(
141 storage_partition_impl_.get()); 143 storage_partition_impl_.get());
142 144
143 SetMaxSyncAttemptsAndRestartManager(1); 145 SetMaxSyncAttemptsAndRestartManager(1);
144 146
145 // Wait for storage to finish initializing before registering service 147 // Wait for storage to finish initializing before registering service
146 // workers. 148 // workers.
147 base::RunLoop().RunUntilIdle(); 149 base::RunLoop().RunUntilIdle();
148 RegisterServiceWorkers(); 150 RegisterServiceWorkers();
149 } 151 }
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 // Run it again. 1314 // Run it again.
1313 test_clock_->Advance(test_background_sync_manager_->delayed_task_delta()); 1315 test_clock_->Advance(test_background_sync_manager_->delayed_task_delta());
1314 test_background_sync_manager_->delayed_task().Run(); 1316 test_background_sync_manager_->delayed_task().Run();
1315 base::RunLoop().RunUntilIdle(); 1317 base::RunLoop().RunUntilIdle();
1316 EXPECT_FALSE(GetRegistration(sync_options_1_)); 1318 EXPECT_FALSE(GetRegistration(sync_options_1_));
1317 EXPECT_EQ(blink::mojom::BackgroundSyncEventLastChance::IS_LAST_CHANCE, 1319 EXPECT_EQ(blink::mojom::BackgroundSyncEventLastChance::IS_LAST_CHANCE,
1318 test_background_sync_manager_->last_chance()); 1320 test_background_sync_manager_->last_chance());
1319 } 1321 }
1320 1322
1321 } // namespace content 1323 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698