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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/password_manager/password_store_factory.h" | 9 #include "chrome/browser/password_manager/password_store_factory.h" |
10 #include "chrome/browser/profiles/profile_info_cache.h" | 10 #include "chrome/browser/profiles/profile_info_cache.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
389 EXPECT_EQ(2U, browser_list->size()); | 389 EXPECT_EQ(2U, browser_list->size()); |
390 ASSERT_EQ(2U, cache.GetNumberOfProfiles()); | 390 ASSERT_EQ(2U, cache.GetNumberOfProfiles()); |
391 | 391 |
392 // The second should though. | 392 // The second should though. |
393 browser_list->get(1)->window()->Close(); | 393 browser_list->get(1)->window()->Close(); |
394 content::RunAllPendingInMessageLoop(); | 394 content::RunAllPendingInMessageLoop(); |
395 EXPECT_EQ(1U, browser_list->size()); | 395 EXPECT_EQ(1U, browser_list->size()); |
396 ASSERT_EQ(1U, cache.GetNumberOfProfiles()); | 396 ASSERT_EQ(1U, cache.GetNumberOfProfiles()); |
397 } | 397 } |
398 | 398 |
399 // The test is ending with timeout on Win. It's not important because there is | |
400 // no keychain on Windows. | |
battre
2014/06/02 13:18:03
nit: Keychain (capital letter)
| |
401 #if !defined(OS_WIN) | |
399 IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, DeletePasswords) { | 402 IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, DeletePasswords) { |
400 Profile* profile = ProfileManager::GetActiveUserProfile(); | 403 Profile* profile = ProfileManager::GetActiveUserProfile(); |
401 ASSERT_TRUE(profile); | 404 ASSERT_TRUE(profile); |
402 | 405 |
403 autofill::PasswordForm form; | 406 autofill::PasswordForm form; |
404 form.scheme = autofill::PasswordForm::SCHEME_HTML; | 407 form.scheme = autofill::PasswordForm::SCHEME_HTML; |
405 form.origin = GURL("http://accounts.google.com/LoginAuth"); | 408 form.origin = GURL("http://accounts.google.com/LoginAuth"); |
406 form.signon_realm = "http://accounts.google.com/"; | 409 form.signon_realm = "http://accounts.google.com/"; |
407 form.username_value = base::ASCIIToUTF16("my_username"); | 410 form.username_value = base::ASCIIToUTF16("my_username"); |
408 form.password_value = base::ASCIIToUTF16("my_password"); | 411 form.password_value = base::ASCIIToUTF16("my_password"); |
(...skipping 25 matching lines...) Expand all Loading... | |
434 FROM_HERE, | 437 FROM_HERE, |
435 run_loop.QuitClosure()); | 438 run_loop.QuitClosure()); |
436 EXPECT_TRUE(password_store->ScheduleTask(task)); | 439 EXPECT_TRUE(password_store->ScheduleTask(task)); |
437 run_loop.Run(); | 440 run_loop.Run(); |
438 | 441 |
439 EXPECT_TRUE(verify_add.IsCalled()); | 442 EXPECT_TRUE(verify_add.IsCalled()); |
440 EXPECT_EQ(1u, verify_add.GetPasswords().size()); | 443 EXPECT_EQ(1u, verify_add.GetPasswords().size()); |
441 EXPECT_TRUE(verify_delete.IsCalled()); | 444 EXPECT_TRUE(verify_delete.IsCalled()); |
442 EXPECT_EQ(0u, verify_delete.GetPasswords().size()); | 445 EXPECT_EQ(0u, verify_delete.GetPasswords().size()); |
443 } | 446 } |
447 #endif | |
battre
2014/06/02 13:18:03
#endif // !defined(OS_WIN)
?
| |
OLD | NEW |