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

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

Issue 1423313006: Add browser tests for clearing sync registrations with site data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 void RemoveWindowClients() { 313 void RemoveWindowClients() {
314 helper_->context()->RemoveAllProviderHostsForProcess(kRenderProcessId); 314 helper_->context()->RemoveAllProviderHostsForProcess(kRenderProcessId);
315 } 315 }
316 316
317 void SetNetwork(net::NetworkChangeNotifier::ConnectionType connection_type) { 317 void SetNetwork(net::NetworkChangeNotifier::ConnectionType connection_type) {
318 net::NetworkChangeNotifier::NotifyObserversOfNetworkChangeForTests( 318 net::NetworkChangeNotifier::NotifyObserversOfNetworkChangeForTests(
319 connection_type); 319 connection_type);
320 if (test_background_sync_manager_) { 320 if (test_background_sync_manager_) {
321 BackgroundSyncNetworkObserver* network_observer = 321 BackgroundSyncNetworkObserver* network_observer =
322 test_background_sync_manager_->GetNetworkObserverForTesting(); 322 test_background_sync_manager_->GetNetworkObserverForTesting();
323 network_observer->NotifyManagerIfNetworkChanged(connection_type); 323 network_observer->NotifyManagerIfNetworkChangedForTesting(
324 connection_type);
324 base::RunLoop().RunUntilIdle(); 325 base::RunLoop().RunUntilIdle();
325 } 326 }
326 } 327 }
327 328
328 void SetOnBatteryPower(bool on_battery_power) { 329 void SetOnBatteryPower(bool on_battery_power) {
329 power_monitor_source_->GeneratePowerStateEvent(on_battery_power); 330 power_monitor_source_->GeneratePowerStateEvent(on_battery_power);
330 base::RunLoop().RunUntilIdle(); 331 base::RunLoop().RunUntilIdle();
331 } 332 }
332 333
333 void StatusAndRegistrationCallback( 334 void StatusAndRegistrationCallback(
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 test_background_sync_manager_->set_corrupt_backend(false); 1735 test_background_sync_manager_->set_corrupt_backend(false);
1735 DeleteServiceWorkerAndStartOver(); 1736 DeleteServiceWorkerAndStartOver();
1736 1737
1737 RegisterServiceWorkers(); 1738 RegisterServiceWorkers();
1738 1739
1739 EXPECT_FALSE(GetRegistrations(SYNC_ONE_SHOT)); 1740 EXPECT_FALSE(GetRegistrations(SYNC_ONE_SHOT));
1740 EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, callback_status_); 1741 EXPECT_EQ(BACKGROUND_SYNC_STATUS_STORAGE_ERROR, callback_status_);
1741 } 1742 }
1742 1743
1743 } // namespace content 1744 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698