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 "extensions/common/feature_switch.h" | 5 #include "extensions/common/feature_switch.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
11 | 10 |
12 using extensions::FeatureSwitch; | 11 using extensions::FeatureSwitch; |
13 | 12 |
14 namespace { | 13 namespace { |
15 | 14 |
16 const char kSwitchName[] = "test-switch"; | 15 const char kSwitchName[] = "test-switch"; |
17 const char kFieldTrialName[] = "field-trial"; | 16 const char kFieldTrialName[] = "field-trial"; |
18 | 17 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 required_trials.push_back(kFieldTrialName); | 323 required_trials.push_back(kFieldTrialName); |
325 const char* required_trial_name = "required-trial"; | 324 const char* required_trial_name = "required-trial"; |
326 scoped_refptr<base::FieldTrial> enabled_required_trial = | 325 scoped_refptr<base::FieldTrial> enabled_required_trial = |
327 CreateFieldTrialWithName(required_trial_name, "Disabled"); | 326 CreateFieldTrialWithName(required_trial_name, "Disabled"); |
328 required_trials.push_back(required_trial_name); | 327 required_trials.push_back(required_trial_name); |
329 FeatureSwitch trial_enabled_switch(&command_line_, kSwitchName, | 328 FeatureSwitch trial_enabled_switch(&command_line_, kSwitchName, |
330 required_trials, | 329 required_trials, |
331 FeatureSwitch::DEFAULT_DISABLED); | 330 FeatureSwitch::DEFAULT_DISABLED); |
332 EXPECT_FALSE(trial_enabled_switch.IsEnabled()); | 331 EXPECT_FALSE(trial_enabled_switch.IsEnabled()); |
333 } | 332 } |
OLD | NEW |