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

Unified Diff: components/metrics/test_enabled_state_provider.h

Issue 1958003003: Splitting the concept of UMA consent, and should UMA report. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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: components/metrics/test_enabled_state_provider.h
diff --git a/components/metrics/test_enabled_state_provider.h b/components/metrics/test_enabled_state_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..001601b60a9c6f39f4ea0d1033d3e3b3db7d0097
--- /dev/null
+++ b/components/metrics/test_enabled_state_provider.h
@@ -0,0 +1,37 @@
+// 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.
+
+#ifndef COMPONENTS_METRICS_TEST_ENABLED_STATE_PROVIDER_H_
+#define COMPONENTS_METRICS_TEST_ENABLED_STATE_PROVIDER_H_
+
+#include "base/macros.h"
+#include "components/metrics/enabled_state_provider.h"
+
+namespace metrics {
+
+// A simple concrete implementation of the EnabledStateProvider interface, for
+// use in tests.
+class TestEnabledStateProvider : public EnabledStateProvider {
+ public:
+ TestEnabledStateProvider(bool consent, bool enabled)
+ : consent_(consent), enabled_(enabled) {}
+ ~TestEnabledStateProvider() override {}
+
+ // EnabledStateProvider
+ bool IsConsentGiven() override;
+ bool IsReportingEnabled() override;
+
+ void set_consent(bool consent) { consent_ = consent; }
+ void set_enabled(bool enabled) { enabled_ = enabled; }
+
+ private:
+ bool consent_;
+ bool enabled_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestEnabledStateProvider);
+};
+
+} // namespace metrics
+
+#endif // COMPONENTS_METRICS_TEST_ENABLED_STATE_PROVIDER_H_
« no previous file with comments | « components/metrics/metrics_state_manager_unittest.cc ('k') | components/metrics/test_enabled_state_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698