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

Unified Diff: components/network_time/network_time_test_utils.h

Issue 2421143002: Fix broken clockstate.network2 histogram and add unit test (Closed)
Patch Set: meacer suggestion: move field trial into test util Created 4 years, 2 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
« no previous file with comments | « components/network_time/BUILD.gn ('k') | components/network_time/network_time_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/network_time/network_time_test_utils.h
diff --git a/components/network_time/network_time_test_utils.h b/components/network_time/network_time_test_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..09dee4c7e05c958273d0da005f78088e57fe527c
--- /dev/null
+++ b/components/network_time/network_time_test_utils.h
@@ -0,0 +1,42 @@
+// 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_NETWORK_TIME_NETWORK_TIME_TEST_UTILS_H_
+#define COMPONENTS_NETWORK_TIME_NETWORK_TIME_TEST_UTILS_H_
+
+#include <map>
+#include <memory>
+
+#include "base/macros.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace base {
+namespace test {
+class ScopedFeatureList;
+}; // namespace test
+
+class FieldTrialList;
+} // namespace base
+
+namespace network_time {
+// A test fixture that allows configuring the network time queries field trial.
+class FieldTrialTest : public ::testing::Test {
+ public:
+ FieldTrialTest();
+ ~FieldTrialTest() override;
+
+ protected:
+ void SetNetworkQueriesWithVariationsService(bool enable,
+ float query_probability);
+
+ private:
+ std::unique_ptr<base::FieldTrialList> field_trial_list_;
+ std::unique_ptr<base::test::ScopedFeatureList> scoped_feature_list_;
+
+ DISALLOW_COPY_AND_ASSIGN(FieldTrialTest);
+};
+
+} // namespace network_time
+
+#endif // COMPONENTS_NETWORK_TIME_NETWORK_TIME_TEST_UTILS_H_
« no previous file with comments | « components/network_time/BUILD.gn ('k') | components/network_time/network_time_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698