Moved TestBackgroundSyncController to MockBackgroundSyncController
This is the first in a series of patches to add a content setting to
Background Sync.
In particular, this change will enable adding a method to
BackgroundSyncController that returns a permission status and mocking
it for tests. We can't just add a method to the controller that
returns a granted permission - this would be risky, but we do want to
control permission during tests.
Original, 'big picture' patch: crrev.com/1673303002
TEST=Existing background sync tests don't break.
BUG=564052
Review URL: https://codereview.chromium.org/1695503004
Cr-Commit-Position: refs/heads/master@{#375646}
diff --git a/content/test/mock_background_sync_controller.cc b/content/test/mock_background_sync_controller.cc
new file mode 100644
index 0000000..2d9dbde
--- /dev/null
+++ b/content/test/mock_background_sync_controller.cc
@@ -0,0 +1,27 @@
+// Copyright 2016 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.
+
+#include "content/test/mock_background_sync_controller.h"
+
+namespace content {
+
+void MockBackgroundSyncController::NotifyBackgroundSyncRegistered(
+ const GURL& origin) {
+ registration_count_ += 1;
+ registration_origin_ = origin;
+}
+
+void MockBackgroundSyncController::RunInBackground(bool enabled,
+ int64_t min_ms) {
+ run_in_background_count_ += 1;
+ run_in_background_enabled_ = enabled;
+ run_in_background_min_ms_ = min_ms;
+}
+
+void MockBackgroundSyncController::GetParameterOverrides(
+ BackgroundSyncParameters* parameters) const {
+ *parameters = background_sync_parameters_;
+}
+
+} // namespace content