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 3 // found in the LICENSE file. 4 5 #ifndef CONTENT_PUBLIC_TEST_BACKGROUND_SYNC_TEST_UTILS_H_ 6 #define CONTENT_PUBLIC_TEST_BACKGROUND_SYNC_TEST_UTILS_H_ 7 8 namespace content { 9 class WebContents; 10 11 // Utility namespace for background sync tests. 12 namespace background_sync_test_util { 13 14 // Enables or disables notifications coming from the NetworkConnectionTracker. 15 // (For preventing flakes in tests) 16 void SetIgnoreNetworkChanges(bool ignore); 17 18 // Puts background sync manager into online or offline mode for tests. 19 // 20 // This eventually (asynchronously) runs on the service worker core thread. 21 // However you can start performing background sync operations without waiting 22 // for the core thread task to complete, since those background sync operations 23 // also run on the core thread. 24 void SetOnline(WebContents* web_contents, bool online); 25 26 } // namespace background_sync_test_util 27 28 } // namespace content 29 30 #endif // CONTENT_PUBLIC_TEST_BACKGROUND_SYNC_TEST_UTILS_H_ 31