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

Unified Diff: components/component_updater/component_updater_service_unittest.cc

Issue 1440393002: Reland of Change the update_client task runner behavior to continue on shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « components/component_updater/component_updater_service.cc ('k') | components/update_client/task.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/component_updater/component_updater_service_unittest.cc
diff --git a/components/component_updater/component_updater_service_unittest.cc b/components/component_updater/component_updater_service_unittest.cc
index c44c63b7c1482c3efde1bb0c6d43c337b379c141..9d78eb89ceb7370cdaac438f95028bb4ef33102c 100644
--- a/components/component_updater/component_updater_service_unittest.cc
+++ b/components/component_updater/component_updater_service_unittest.cc
@@ -71,6 +71,7 @@
MOCK_CONST_METHOD2(GetCrxUpdateState,
bool(const std::string& id, CrxUpdateItem* update_item));
MOCK_CONST_METHOD1(IsUpdating, bool(const std::string& id));
+ MOCK_METHOD0(Stop, void());
private:
~MockUpdateClient() override;
@@ -190,12 +191,14 @@
TEST_F(ComponentUpdaterTest, AddObserver) {
MockServiceObserver observer;
EXPECT_CALL(update_client(), AddObserver(&observer)).Times(1);
+ EXPECT_CALL(update_client(), Stop()).Times(1);
component_updater().AddObserver(&observer);
}
TEST_F(ComponentUpdaterTest, RemoveObserver) {
MockServiceObserver observer;
EXPECT_CALL(update_client(), RemoveObserver(&observer)).Times(1);
+ EXPECT_CALL(update_client(), Stop()).Times(1);
component_updater().RemoveObserver(&observer);
}
@@ -250,6 +253,7 @@
.WillRepeatedly(Invoke(&loop_handler, &LoopHandler::OnUpdate));
EXPECT_CALL(update_client(), IsUpdating(id1)).Times(1);
+ EXPECT_CALL(update_client(), Stop()).Times(1);
EXPECT_TRUE(component_updater().RegisterComponent(crx_component1));
EXPECT_TRUE(component_updater().RegisterComponent(crx_component2));
@@ -301,6 +305,7 @@
EXPECT_CALL(update_client(),
Install("jebgalgnebhfojomionfpkfelancnnkf", _, _))
.WillOnce(Invoke(&loop_handler, &LoopHandler::OnInstall));
+ EXPECT_CALL(update_client(), Stop()).Times(1);
EXPECT_TRUE(cus.RegisterComponent(crx_component));
EXPECT_TRUE(OnDemandTester::OnDemand(&cus, id));
@@ -345,6 +350,7 @@
EXPECT_CALL(update_client(),
Install("jebgalgnebhfojomionfpkfelancnnkf", _, _))
.WillOnce(Invoke(&loop_handler, &LoopHandler::OnInstall));
+ EXPECT_CALL(update_client(), Stop()).Times(1);
EXPECT_TRUE(component_updater().RegisterComponent(crx_component));
component_updater().MaybeThrottle(
« no previous file with comments | « components/component_updater/component_updater_service.cc ('k') | components/update_client/task.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698