Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Side by Side Diff: chrome/browser/profiles/profile_manager_browsertest.cc

Issue 509583002: Remove implicit conversions from scoped_refptr to T* in chrome/browser/profiles/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/profiles/profile_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 form.signon_realm = "http://accounts.google.com/"; 414 form.signon_realm = "http://accounts.google.com/";
415 form.username_value = base::ASCIIToUTF16("my_username"); 415 form.username_value = base::ASCIIToUTF16("my_username");
416 form.password_value = base::ASCIIToUTF16("my_password"); 416 form.password_value = base::ASCIIToUTF16("my_password");
417 form.ssl_valid = false; 417 form.ssl_valid = false;
418 form.preferred = true; 418 form.preferred = true;
419 form.blacklisted_by_user = false; 419 form.blacklisted_by_user = false;
420 420
421 scoped_refptr<password_manager::PasswordStore> password_store = 421 scoped_refptr<password_manager::PasswordStore> password_store =
422 PasswordStoreFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS) 422 PasswordStoreFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS)
423 .get(); 423 .get();
424 ASSERT_TRUE(password_store); 424 ASSERT_TRUE(password_store.get());
425 425
426 password_store->AddLogin(form); 426 password_store->AddLogin(form);
427 PasswordStoreConsumerVerifier verify_add; 427 PasswordStoreConsumerVerifier verify_add;
428 password_store->GetAutofillableLogins(&verify_add); 428 password_store->GetAutofillableLogins(&verify_add);
429 429
430 ProfileManager* profile_manager = g_browser_process->profile_manager(); 430 ProfileManager* profile_manager = g_browser_process->profile_manager();
431 profile_manager->ScheduleProfileForDeletion(profile->GetPath(), 431 profile_manager->ScheduleProfileForDeletion(profile->GetPath(),
432 ProfileManager::CreateCallback()); 432 ProfileManager::CreateCallback());
433 content::RunAllPendingInMessageLoop(); 433 content::RunAllPendingInMessageLoop();
434 PasswordStoreConsumerVerifier verify_delete; 434 PasswordStoreConsumerVerifier verify_delete;
435 password_store->GetAutofillableLogins(&verify_delete); 435 password_store->GetAutofillableLogins(&verify_delete);
436 436
437 // Run the password background thread. 437 // Run the password background thread.
438 base::RunLoop run_loop; 438 base::RunLoop run_loop;
439 base::Closure task = base::Bind( 439 base::Closure task = base::Bind(
440 base::IgnoreResult(&content::BrowserThread::PostTask), 440 base::IgnoreResult(&content::BrowserThread::PostTask),
441 content::BrowserThread::UI, 441 content::BrowserThread::UI,
442 FROM_HERE, 442 FROM_HERE,
443 run_loop.QuitClosure()); 443 run_loop.QuitClosure());
444 EXPECT_TRUE(password_store->ScheduleTask(task)); 444 EXPECT_TRUE(password_store->ScheduleTask(task));
445 run_loop.Run(); 445 run_loop.Run();
446 446
447 EXPECT_TRUE(verify_add.IsCalled()); 447 EXPECT_TRUE(verify_add.IsCalled());
448 EXPECT_EQ(1u, verify_add.GetPasswords().size()); 448 EXPECT_EQ(1u, verify_add.GetPasswords().size());
449 EXPECT_TRUE(verify_delete.IsCalled()); 449 EXPECT_TRUE(verify_delete.IsCalled());
450 EXPECT_EQ(0u, verify_delete.GetPasswords().size()); 450 EXPECT_EQ(0u, verify_delete.GetPasswords().size());
451 } 451 }
452 #endif // !defined(OS_WIN) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) 452 #endif // !defined(OS_WIN) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698