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

Unified Diff: chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.cc

Issue 10917120: Activate the VariationsService for ChromeOS and ensure that it does not ping the server until the E… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comments addressed. Created 8 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: chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.cc
diff --git a/chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.cc b/chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..903e384321857bab3e391d3952747ef4718a9050
--- /dev/null
+++ b/chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.cc
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 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 "chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.h"
+
+TestRequestAllowedNotifier::TestRequestAllowedNotifier()
+ : requests_allowed_(true),
+#if defined(OS_CHROMEOS)
+ eula_accepted_(false),
+#endif
+ override_requests_allowed_(true) {
+}
+
+TestRequestAllowedNotifier::~TestRequestAllowedNotifier() {
+}
+
+#if defined(OS_CHROMEOS)
+void TestRequestAllowedNotifier::SetEulaAccepted(bool accepted) {
+ eula_accepted_ = accepted;
+}
+#endif
+
+void TestRequestAllowedNotifier::SetRequestsAllowed(bool allowed) {
+ requests_allowed_ = allowed;
+}
+
+void TestRequestAllowedNotifier::OverrideRequestsAllowed(bool override) {
+ override_requests_allowed_ = override;
+}
+
+void TestRequestAllowedNotifier::NotifyObservers() {
+ requests_allowed_ = true;
+ MaybeNotifyObservers();
+}
+
+#if defined(OS_CHROMEOS)
+bool TestRequestAllowedNotifier::IsEulaAccepted() {
+ return eula_accepted_;
+}
+#endif
+
+bool TestRequestAllowedNotifier::ResourceRequestsAllowed() {
+ if (override_requests_allowed_)
+ return requests_allowed_;
+ else
Alexei Svitkine (slow) 2012/09/20 21:39:03 Nit: remove the else and unindent the next line.
SteveT 2012/09/21 15:16:17 Done.
+ return ResourceRequestAllowedNotifier::ResourceRequestsAllowed();
+}

Powered by Google App Engine
This is Rietveld 408576698