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

Unified Diff: chrome/browser/background/background_application_list_model_unittest.cc

Issue 421193002: Fix ExtensionServiceTest.ClearExtensionData flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use base::DoNothing for empty callbacks Created 6 years, 5 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: chrome/browser/background/background_application_list_model_unittest.cc
diff --git a/chrome/browser/background/background_application_list_model_unittest.cc b/chrome/browser/background/background_application_list_model_unittest.cc
index fd328db65f92c2da7023d9de2f1e2522c227d556..7da262595519bda6b304bdb887b8a5074cfb2e07 100644
--- a/chrome/browser/background/background_application_list_model_unittest.cc
+++ b/chrome/browser/background/background_application_list_model_unittest.cc
@@ -227,28 +227,38 @@ TEST_F(BackgroundApplicationListModelTest, MAYBE_ExplicitTest) {
// Remove in FIFO order.
ASSERT_FALSE(IsBackgroundApp(*ext1.get()));
- service->UninstallExtension(
- ext1->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(ext1->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(4U, service->extensions()->size());
ASSERT_EQ(2U, model->size());
ASSERT_TRUE(IsBackgroundApp(*bgapp1.get()));
- service->UninstallExtension(
- bgapp1->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(bgapp1->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(3U, service->extensions()->size());
ASSERT_EQ(1U, model->size());
ASSERT_FALSE(IsBackgroundApp(*ext2.get()));
- service->UninstallExtension(
- ext2->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(ext2->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(2U, service->extensions()->size());
ASSERT_EQ(1U, model->size());
ASSERT_TRUE(IsBackgroundApp(*bgapp2.get()));
- service->UninstallExtension(
- bgapp2->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(bgapp2->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(1U, service->extensions()->size());
ASSERT_EQ(0U, model->size());
ASSERT_FALSE(IsBackgroundApp(*ext3.get()));
- service->UninstallExtension(
- ext3->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(ext3->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(0U, service->extensions()->size());
ASSERT_EQ(0U, model->size());
}
@@ -299,8 +309,10 @@ TEST_F(BackgroundApplicationListModelTest, PushMessagingTest) {
ASSERT_EQ(2U, model->size());
// Need to remove ext2 because it uses same id as bgapp3.
ASSERT_FALSE(IsBackgroundApp(*ext2.get()));
- service->UninstallExtension(
- ext2->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(ext2->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(3U, service->extensions()->size());
ASSERT_EQ(2U, model->size());
ASSERT_TRUE(IsBackgroundApp(*bgapp3.get()));
@@ -310,23 +322,31 @@ TEST_F(BackgroundApplicationListModelTest, PushMessagingTest) {
// Remove in FIFO order.
ASSERT_FALSE(IsBackgroundApp(*ext1.get()));
- service->UninstallExtension(
- ext1->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(ext1->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(3U, service->extensions()->size());
ASSERT_EQ(3U, model->size());
ASSERT_TRUE(IsBackgroundApp(*bgapp1.get()));
- service->UninstallExtension(
- bgapp1->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(bgapp1->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(2U, service->extensions()->size());
ASSERT_EQ(2U, model->size());
ASSERT_TRUE(IsBackgroundApp(*bgapp2.get()));
- service->UninstallExtension(
- bgapp2->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(bgapp2->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(1U, service->extensions()->size());
ASSERT_EQ(1U, model->size());
ASSERT_TRUE(IsBackgroundApp(*bgapp3.get()));
- service->UninstallExtension(
- bgapp3->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(bgapp3->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(0U, service->extensions()->size());
ASSERT_EQ(0U, model->size());
}
@@ -486,8 +506,10 @@ void RemoveExtension(ExtensionService* service,
extensions->erase(cursor);
--*count;
ASSERT_EQ(*count, extensions->size());
- service->UninstallExtension(
- extension->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
+ service->UninstallExtension(extension->id(),
+ extensions::UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing),
+ NULL);
ASSERT_EQ(*count, service->extensions()->size());
ASSERT_EQ(*expected, model->size());
}
« no previous file with comments | « chrome/browser/apps/ephemeral_app_service.cc ('k') | chrome/browser/browsing_data/browsing_data_remover_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698