diff options
Diffstat (limited to 'chromium/components/password_manager/core/browser/form_fetcher_impl_unittest.cc')
-rw-r--r-- | chromium/components/password_manager/core/browser/form_fetcher_impl_unittest.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chromium/components/password_manager/core/browser/form_fetcher_impl_unittest.cc b/chromium/components/password_manager/core/browser/form_fetcher_impl_unittest.cc index 07cf4325d65..45d41d15e9b 100644 --- a/chromium/components/password_manager/core/browser/form_fetcher_impl_unittest.cc +++ b/chromium/components/password_manager/core/browser/form_fetcher_impl_unittest.cc @@ -11,12 +11,11 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" -#include "base/message_loop/message_loop.h" -#include "base/run_loop.h" #include "base/stl_util.h" #include "base/strings/string16.h" #include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_task_environment.h" #include "build/build_config.h" #include "components/autofill/core/common/password_form.h" #include "components/password_manager/core/browser/mock_password_store.h" @@ -195,7 +194,8 @@ class FormFetcherImplTest : public testing::Test { : form_digest_(PasswordForm::SCHEME_HTML, kTestHttpURL, GURL(kTestHttpURL)) { - mock_store_ = new MockPasswordStore(); + mock_store_ = new MockPasswordStore; + mock_store_->Init(syncer::SyncableService::StartSyncFlare(), nullptr); client_.set_store(mock_store_.get()); form_fetcher_ = base::MakeUnique<FormFetcherImpl>( @@ -214,7 +214,7 @@ class FormFetcherImplTest : public testing::Test { #endif EXPECT_CALL(*mock_store_, GetLogins(form_digest_, form_fetcher_.get())); form_fetcher_->Fetch(); - base::RunLoop().RunUntilIdle(); + scoped_task_environment_.RunUntilIdle(); testing::Mock::VerifyAndClearExpectations(mock_store_.get()); } @@ -267,7 +267,7 @@ class FormFetcherImplTest : public testing::Test { ASSERT_EQ(FormFetcher::State::NOT_WAITING, form_fetcher_->GetState()); } - base::MessageLoop message_loop_; // Used by mock_store_. + base::test::ScopedTaskEnvironment scoped_task_environment_; PasswordStore::FormDigest form_digest_; std::unique_ptr<FormFetcherImpl> form_fetcher_; MockConsumer consumer_; @@ -455,7 +455,7 @@ TEST_F(FormFetcherImplTest, FetchStatistics) { EXPECT_CALL(*mock_store_, GetSiteStatsImpl(stats.origin_domain)) .WillOnce(Return(db_stats)); form_fetcher_->Fetch(); - base::RunLoop().RunUntilIdle(); + scoped_task_environment_.RunUntilIdle(); EXPECT_THAT(form_fetcher_->GetInteractionsStats(), UnorderedElementsAre(stats)); @@ -465,7 +465,7 @@ TEST_F(FormFetcherImplTest, DontFetchStatistics) { EXPECT_CALL(*mock_store_, GetLogins(form_digest_, form_fetcher_.get())); EXPECT_CALL(*mock_store_, GetSiteStatsImpl(_)).Times(0); form_fetcher_->Fetch(); - base::RunLoop().RunUntilIdle(); + scoped_task_environment_.RunUntilIdle(); } #endif |