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

Unified Diff: components/password_manager/core/browser/affiliation_service_unittest.cc

Issue 1008373003: Integrate throttling logic into AffiliationBackend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/affiliation_service_unittest.cc
diff --git a/components/password_manager/core/browser/affiliation_service_unittest.cc b/components/password_manager/core/browser/affiliation_service_unittest.cc
index e1889f73c452d71ee2232d2eeb91691517c1f1a9..61764b82849c0322a98c18d99e79992f4399f17c 100644
--- a/components/password_manager/core/browser/affiliation_service_unittest.cc
+++ b/components/password_manager/core/browser/affiliation_service_unittest.cc
@@ -43,8 +43,8 @@ class AffiliationServiceTest : public testing::Test {
public:
AffiliationServiceTest()
: main_task_runner_(new base::TestSimpleTaskRunner),
- background_task_runner_(new base::TestMockTimeTaskRunner),
- main_task_runner_handle_(main_task_runner_) {}
+ main_task_runner_handle_(main_task_runner_),
+ background_task_runner_(new base::TestMockTimeTaskRunner) {}
~AffiliationServiceTest() override {}
protected:
@@ -86,11 +86,12 @@ class AffiliationServiceTest : public testing::Test {
background_task_runner_->RunUntilIdle();
}
- ScopedFakeAffiliationAPI fake_affiliation_api_;
- MockAffiliationConsumer mock_consumer_;
scoped_refptr<base::TestSimpleTaskRunner> main_task_runner_;
- scoped_refptr<base::TestMockTimeTaskRunner> background_task_runner_;
base::ThreadTaskRunnerHandle main_task_runner_handle_;
+ scoped_refptr<base::TestMockTimeTaskRunner> background_task_runner_;
+
+ ScopedFakeAffiliationAPI fake_affiliation_api_;
+ MockAffiliationConsumer mock_consumer_;
scoped_ptr<AffiliationService> service_;
@@ -141,11 +142,10 @@ TEST_F(AffiliationServiceTest, GetAffiliations) {
TEST_F(AffiliationServiceTest, ShutdownWhileTasksArePosted) {
service()->GetAffiliations(FacetURI::FromCanonicalSpec(kTestFacetURIAlpha1),
false, mock_consumer()->GetResultCallback());
- DestroyService();
+ EXPECT_TRUE(background_task_runner()->HasPendingTask());
+ DestroyService();
background_task_runner()->RunUntilIdle();
- ASSERT_TRUE(fake_affiliation_api()->HasPendingRequest());
- fake_affiliation_api()->IgnoreNextRequest();
mock_consumer()->ExpectFailure();
main_task_runner()->RunUntilIdle();

Powered by Google App Engine
This is Rietveld 408576698