| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/variations/variations_seed_processor.h" | 5 #include "components/variations/variations_seed_processor.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 7 #include <map> | 10 #include <map> |
| 8 #include <vector> | 11 #include <vector> |
| 9 | 12 |
| 10 #include "base/bind.h" | 13 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 12 #include "base/feature_list.h" | 15 #include "base/feature_list.h" |
| 13 #include "base/format_macros.h" | 16 #include "base/format_macros.h" |
| 17 #include "base/macros.h" |
| 14 #include "base/strings/string_split.h" | 18 #include "base/strings/string_split.h" |
| 15 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 17 #include "components/variations/processed_study.h" | 21 #include "components/variations/processed_study.h" |
| 18 #include "components/variations/variations_associated_data.h" | 22 #include "components/variations/variations_associated_data.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 20 | 24 |
| 21 namespace variations { | 25 namespace variations { |
| 22 | 26 |
| 23 namespace { | 27 namespace { |
| 24 | 28 |
| 25 // Converts |time| to Study proto format. | 29 // Converts |time| to Study proto format. |
| 26 int64 TimeToProtoTime(const base::Time& time) { | 30 int64_t TimeToProtoTime(const base::Time& time) { |
| 27 return (time - base::Time::UnixEpoch()).InSeconds(); | 31 return (time - base::Time::UnixEpoch()).InSeconds(); |
| 28 } | 32 } |
| 29 | 33 |
| 30 // Constants for testing associating command line flags with trial groups. | 34 // Constants for testing associating command line flags with trial groups. |
| 31 const char kFlagStudyName[] = "flag_test_trial"; | 35 const char kFlagStudyName[] = "flag_test_trial"; |
| 32 const char kFlagGroup1Name[] = "flag_group1"; | 36 const char kFlagGroup1Name[] = "flag_group1"; |
| 33 const char kFlagGroup2Name[] = "flag_group2"; | 37 const char kFlagGroup2Name[] = "flag_group2"; |
| 34 const char kNonFlagGroupName[] = "non_flag_group"; | 38 const char kNonFlagGroupName[] = "non_flag_group"; |
| 35 const char kForcingFlag1[] = "flag_test1"; | 39 const char kForcingFlag1[] = "flag_test1"; |
| 36 const char kForcingFlag2[] = "flag_test2"; | 40 const char kForcingFlag2[] = "flag_test2"; |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 // depending on the expected values. | 702 // depending on the expected values. |
| 699 EXPECT_FALSE(base::FieldTrialList::IsTrialActive(study.name())); | 703 EXPECT_FALSE(base::FieldTrialList::IsTrialActive(study.name())); |
| 700 EXPECT_EQ(test_case.expected_feature_state, | 704 EXPECT_EQ(test_case.expected_feature_state, |
| 701 base::FeatureList::IsEnabled(test_case.feature)); | 705 base::FeatureList::IsEnabled(test_case.feature)); |
| 702 EXPECT_EQ(test_case.expected_trial_activated, | 706 EXPECT_EQ(test_case.expected_trial_activated, |
| 703 base::FieldTrialList::IsTrialActive(study.name())); | 707 base::FieldTrialList::IsTrialActive(study.name())); |
| 704 } | 708 } |
| 705 } | 709 } |
| 706 | 710 |
| 707 } // namespace variations | 711 } // namespace variations |
| OLD | NEW |