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/password_manager_test_utils.h " | 5 #include "components/password_manager/core/browser/password_manager_test_utils.h " |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/feature_list.h" | |
11 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
13 | 14 |
14 using autofill::PasswordForm; | 15 using autofill::PasswordForm; |
15 | 16 |
16 namespace password_manager { | 17 namespace password_manager { |
17 | 18 |
18 const char kTestingIconUrlSpec[] = "https://accounts.google.com/Icon"; | 19 const char kTestingIconUrlSpec[] = "https://accounts.google.com/Icon"; |
19 const char kTestingFederationUrlSpec[] = "https://accounts.google.com/login"; | 20 const char kTestingFederationUrlSpec[] = "https://accounts.google.com/login"; |
20 const int kTestingDaysAfterPasswordsAreSynced = 1; | 21 const int kTestingDaysAfterPasswordsAreSynced = 1; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 for (const PasswordForm* remaining_expected_form : remaining_expectations) { | 89 for (const PasswordForm* remaining_expected_form : remaining_expectations) { |
89 *mismatch_output << std::endl | 90 *mismatch_output << std::endl |
90 << "Unmatched expected form:" << std::endl | 91 << "Unmatched expected form:" << std::endl |
91 << *remaining_expected_form; | 92 << *remaining_expected_form; |
92 } | 93 } |
93 } | 94 } |
94 | 95 |
95 return !had_mismatched_actual_form && remaining_expectations.empty(); | 96 return !had_mismatched_actual_form && remaining_expectations.empty(); |
96 } | 97 } |
97 | 98 |
99 void EnableFeature(const char* feature) { | |
Bernhard Bauer
2016/02/09 15:10:33
Why does this take a char* instead of a Feature?
Pritam Nikam
2016/02/09 16:05:54
base::FeatureList::InitializeFromCommandLine() acc
Bernhard Bauer
2016/02/09 16:13:31
Yes, but you could still take a Feature here and e
Pritam Nikam
2016/02/11 10:51:58
Done.
| |
100 base::FeatureList::ClearInstanceForTesting(); | |
101 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); | |
102 feature_list->InitializeFromCommandLine(feature, ""); | |
103 base::FeatureList::SetInstance(std::move(feature_list)); | |
104 } | |
105 | |
98 MockPasswordStoreObserver::MockPasswordStoreObserver() {} | 106 MockPasswordStoreObserver::MockPasswordStoreObserver() {} |
99 | 107 |
100 MockPasswordStoreObserver::~MockPasswordStoreObserver() {} | 108 MockPasswordStoreObserver::~MockPasswordStoreObserver() {} |
101 | 109 |
102 } // namespace password_manager | 110 } // namespace password_manager |
OLD | NEW |