Index: content/public/test/background_sync_test_util.h |
diff --git a/content/public/test/background_sync_test_util.h b/content/public/test/background_sync_test_util.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0be7f438b5196ef83f171db43ce0f12008553260 |
--- /dev/null |
+++ b/content/public/test/background_sync_test_util.h |
@@ -0,0 +1,30 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_PUBLIC_TEST_BACKGROUND_SYNC_TEST_UTILS_H_ |
+#define CONTENT_PUBLIC_TEST_BACKGROUND_SYNC_TEST_UTILS_H_ |
+ |
+namespace content { |
+ |
+class WebContents; |
+ |
+// Utility class for background sync tests. |
+class BackgroundSyncTestUtil { |
Devlin
2015/11/16 18:12:41
nit: I prefer namespaces for collections of static
lazyboy
2015/11/16 19:30:16
Good point.
Done.
Should this namespace be nested
Devlin
2015/11/17 19:21:16
I'll leave that up to a content/ OWNER. :) (FWIW,
|
+ public: |
+ // Enables or disables notifications coming from the NetworkChangeNotifier. |
+ // (For preventing flakes in tests) |
+ static void SetIgnoreNetworkChangeNotifier(bool ignore); |
+ |
+ // Puts background sync manager into online or offline mode for tests. |
+ // |
+ // This eventually (asynchronously) runs on the IO thread. However you can |
+ // start performing background sync operation without waiting for the IO |
+ // thread task to complete, since those background sync operations also run |
+ // on the IO thread. |
+ static void SetOnline(WebContents* web_contents, bool online); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_TEST_BACKGROUND_SYNC_TEST_UTILS_H_ |