| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/metrics/field_trial.h" | 5 #include "base/metrics/field_trial.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 public: | 42 public: |
| 43 TestFieldTrialObserver() { | 43 TestFieldTrialObserver() { |
| 44 FieldTrialList::AddObserver(this); | 44 FieldTrialList::AddObserver(this); |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual ~TestFieldTrialObserver() { | 47 virtual ~TestFieldTrialObserver() { |
| 48 FieldTrialList::RemoveObserver(this); | 48 FieldTrialList::RemoveObserver(this); |
| 49 } | 49 } |
| 50 | 50 |
| 51 virtual void OnFieldTrialGroupFinalized(const std::string& trial, | 51 virtual void OnFieldTrialGroupFinalized(const std::string& trial, |
| 52 const std::string& group) OVERRIDE { | 52 const std::string& group) override { |
| 53 trial_name_ = trial; | 53 trial_name_ = trial; |
| 54 group_name_ = group; | 54 group_name_ = group; |
| 55 } | 55 } |
| 56 | 56 |
| 57 const std::string& trial_name() const { return trial_name_; } | 57 const std::string& trial_name() const { return trial_name_; } |
| 58 const std::string& group_name() const { return group_name_; } | 58 const std::string& group_name() const { return group_name_; } |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 std::string trial_name_; | 61 std::string trial_name_; |
| 62 std::string group_name_; | 62 std::string group_name_; |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 EXPECT_TRUE(active_groups.empty()); | 986 EXPECT_TRUE(active_groups.empty()); |
| 987 | 987 |
| 988 // The trial shouldn't be listed in the |StatesToString()| result. | 988 // The trial shouldn't be listed in the |StatesToString()| result. |
| 989 std::string states; | 989 std::string states; |
| 990 FieldTrialList::StatesToString(&states); | 990 FieldTrialList::StatesToString(&states); |
| 991 EXPECT_TRUE(states.empty()); | 991 EXPECT_TRUE(states.empty()); |
| 992 } | 992 } |
| 993 } | 993 } |
| 994 | 994 |
| 995 } // namespace base | 995 } // namespace base |
| OLD | NEW |