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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 std::string action = base::StringPrintf("http://%zu.%s.com/action", | 225 std::string action = base::StringPrintf("http://%zu.%s.com/action", |
226 i, domain); | 226 i, domain); |
227 password_manager::PasswordFormData data = { | 227 password_manager::PasswordFormData data = { |
228 PasswordForm::SCHEME_HTML, | 228 PasswordForm::SCHEME_HTML, |
229 realm.c_str(), | 229 realm.c_str(), |
230 origin.c_str(), | 230 origin.c_str(), |
231 action.c_str(), | 231 action.c_str(), |
232 L"submit_element", | 232 L"submit_element", |
233 L"username_element", | 233 L"username_element", |
234 L"password_element", | 234 L"password_element", |
235 autofillable ? L"username_value" : NULL, | 235 autofillable ? L"username_value" : nullptr, |
236 autofillable ? L"password_value" : NULL, | 236 autofillable ? L"password_value" : nullptr, |
237 autofillable, | 237 autofillable, |
238 false, | 238 false, |
239 static_cast<double>(i + 1)}; | 239 static_cast<double>(i + 1)}; |
240 forms->push_back(CreatePasswordFormFromDataForTesting(data).release()); | 240 forms->push_back(CreatePasswordFormFromDataForTesting(data).release()); |
241 } | 241 } |
242 } | 242 } |
243 | 243 |
244 PasswordStoreChangeList AddChangeForForm(const PasswordForm& form) { | 244 PasswordStoreChangeList AddChangeForForm(const PasswordForm& form) { |
245 return PasswordStoreChangeList( | 245 return PasswordStoreChangeList( |
246 1, PasswordStoreChange(PasswordStoreChange::ADD, form)); | 246 1, PasswordStoreChange(PasswordStoreChange::ADD, form)); |
(...skipping 19 matching lines...) Expand all Loading... |
266 return temp_dir_.path().Append(FILE_PATH_LITERAL("login_test")); | 266 return temp_dir_.path().Append(FILE_PATH_LITERAL("login_test")); |
267 } | 267 } |
268 | 268 |
269 PasswordStoreX::NativeBackend* GetBackend() { | 269 PasswordStoreX::NativeBackend* GetBackend() { |
270 switch (GetParam()) { | 270 switch (GetParam()) { |
271 case FAILING_BACKEND: | 271 case FAILING_BACKEND: |
272 return new FailingBackend(); | 272 return new FailingBackend(); |
273 case WORKING_BACKEND: | 273 case WORKING_BACKEND: |
274 return new MockBackend(); | 274 return new MockBackend(); |
275 default: | 275 default: |
276 return NULL; | 276 return nullptr; |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 content::TestBrowserThreadBundle thread_bundle_; | 280 content::TestBrowserThreadBundle thread_bundle_; |
281 | 281 |
282 base::ScopedTempDir temp_dir_; | 282 base::ScopedTempDir temp_dir_; |
283 }; | 283 }; |
284 | 284 |
285 ACTION(STLDeleteElements0) { | 285 ACTION(STLDeleteElements0) { |
286 STLDeleteContainerPointers(arg0.begin(), arg0.end()); | 286 STLDeleteContainerPointers(arg0.begin(), arg0.end()); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 459 |
460 INSTANTIATE_TEST_CASE_P(NoBackend, | 460 INSTANTIATE_TEST_CASE_P(NoBackend, |
461 PasswordStoreXTest, | 461 PasswordStoreXTest, |
462 testing::Values(NO_BACKEND)); | 462 testing::Values(NO_BACKEND)); |
463 INSTANTIATE_TEST_CASE_P(FailingBackend, | 463 INSTANTIATE_TEST_CASE_P(FailingBackend, |
464 PasswordStoreXTest, | 464 PasswordStoreXTest, |
465 testing::Values(FAILING_BACKEND)); | 465 testing::Values(FAILING_BACKEND)); |
466 INSTANTIATE_TEST_CASE_P(WorkingBackend, | 466 INSTANTIATE_TEST_CASE_P(WorkingBackend, |
467 PasswordStoreXTest, | 467 PasswordStoreXTest, |
468 testing::Values(WORKING_BACKEND)); | 468 testing::Values(WORKING_BACKEND)); |
OLD | NEW |