OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/password_manager/core/browser/affiliation_utils.h" | 5 #include "components/password_manager/core/browser/affiliation_utils.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "components/password_manager/core/common/password_manager_switches.h" | 9 #include "components/password_manager/core/common/password_manager_switches.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 {"Enabled", "", true}, | 217 {"Enabled", "", true}, |
218 {"Enabled", switches::kDisableAffiliationBasedMatching, false}, | 218 {"Enabled", switches::kDisableAffiliationBasedMatching, false}, |
219 {"Enabled", switches::kEnableAffiliationBasedMatching, true}}; | 219 {"Enabled", switches::kEnableAffiliationBasedMatching, true}}; |
220 | 220 |
221 for (const auto& test_case : kTestCases) { | 221 for (const auto& test_case : kTestCases) { |
222 SCOPED_TRACE(testing::Message("Command line = ") | 222 SCOPED_TRACE(testing::Message("Command line = ") |
223 << test_case.command_line_switch); | 223 << test_case.command_line_switch); |
224 SCOPED_TRACE(testing::Message("Group name = ") | 224 SCOPED_TRACE(testing::Message("Group name = ") |
225 << test_case.field_trial_group); | 225 << test_case.field_trial_group); |
226 | 226 |
227 base::FieldTrialList field_trials(NULL); | 227 base::FieldTrialList field_trials(nullptr); |
228 base::FieldTrialList::CreateFieldTrial(kFieldTrialName, | 228 base::FieldTrialList::CreateFieldTrial(kFieldTrialName, |
229 test_case.field_trial_group); | 229 test_case.field_trial_group); |
230 | 230 |
231 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); | 231 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
232 command_line.AppendSwitch(test_case.command_line_switch); | 232 command_line.AppendSwitch(test_case.command_line_switch); |
233 EXPECT_EQ(test_case.expected_enabled, | 233 EXPECT_EQ(test_case.expected_enabled, |
234 IsAffiliationBasedMatchingEnabled(command_line)); | 234 IsAffiliationBasedMatchingEnabled(command_line)); |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 } // namespace password_manager | 238 } // namespace password_manager |
OLD | NEW |