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

Unified Diff: content/browser/background_sync/background_sync_manager_unittest.cc

Issue 1376563003: Revert of [BackgroundSync] Trigger Background Sync events when Chrome is backgrounded on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/background_sync/background_sync_manager_unittest.cc
diff --git a/content/browser/background_sync/background_sync_manager_unittest.cc b/content/browser/background_sync/background_sync_manager_unittest.cc
index 3056594e8845bab0c02f8d65894a56be94ebbf45..22e3c76940c6c2f9b69477cfa681cf276a247ab0 100644
--- a/content/browser/background_sync/background_sync_manager_unittest.cc
+++ b/content/browser/background_sync/background_sync_manager_unittest.cc
@@ -12,7 +12,6 @@
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
-#include "content/browser/background_sync/background_sync_network_observer.h"
#include "content/browser/background_sync/background_sync_registration_handle.h"
#include "content/browser/background_sync/background_sync_status.h"
#include "content/browser/browser_thread_impl.h"
@@ -232,9 +231,6 @@
}
void SetUp() override {
- // Don't let the tests be confused by the real-world device connectivity
- BackgroundSyncNetworkObserver::SetIgnoreNetworkChangeNotifierForTests(true);
-
helper_.reset(
new EmbeddedWorkerTestHelper(base::FilePath(), kRenderProcessId));
@@ -251,12 +247,6 @@
// workers.
base::RunLoop().RunUntilIdle();
RegisterServiceWorkers();
- }
-
- void TearDown() override {
- // Restore the network observer functionality for subsequent tests
- BackgroundSyncNetworkObserver::SetIgnoreNetworkChangeNotifierForTests(
- false);
}
void RegisterServiceWorkers() {
@@ -312,12 +302,7 @@
void SetNetwork(net::NetworkChangeNotifier::ConnectionType connection_type) {
net::NetworkChangeNotifier::NotifyObserversOfNetworkChangeForTests(
connection_type);
- if (test_background_sync_manager_) {
- BackgroundSyncNetworkObserver* network_observer =
- test_background_sync_manager_->GetNetworkObserverForTesting();
- network_observer->NotifyManagerIfNetworkChanged(connection_type);
- base::RunLoop().RunUntilIdle();
- }
+ base::RunLoop().RunUntilIdle();
}
void SetOnBatteryPower(bool on_battery_power) {

Powered by Google App Engine
This is Rietveld 408576698