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

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

Issue 1086733002: Ensure tests have an active task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 8 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_contents_service.cc
diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc
index 90a5107c13d2863ff74c5b3ce371540c16904799..406411bdc348518fbf0cd879e50a01c64c37022d 100644
--- a/chrome/browser/background/background_contents_service.cc
+++ b/chrome/browser/background/background_contents_service.cc
@@ -67,6 +67,7 @@ using extensions::UnloadedExtensionInfo;
namespace {
const char kNotificationPrefix[] = "app.background.crashed.";
+bool g_disable_close_balloon_for_testing = false;
void CloseBalloon(const std::string& balloon_id, ProfileID profile_id) {
NotificationUIManager* notification_ui_manager =
@@ -84,7 +85,7 @@ void CloseBalloon(const std::string& balloon_id, ProfileID profile_id) {
// Closes the crash notification balloon for the app/extension with this id.
void ScheduleCloseBalloon(const std::string& extension_id, Profile* profile) {
- if (!base::MessageLoop::current()) // For unit_tests
+ if (g_disable_close_balloon_for_testing)
return;
base::MessageLoop::current()->PostTask(
FROM_HERE,
@@ -293,6 +294,12 @@ void BackgroundContentsService::ShowBalloonForTesting(
ShowBalloon(extension, profile);
}
+// static
+void BackgroundContentsService::DisableCloseBalloonForTesting(
+ bool disable_close_balloon_for_testing) {
+ g_disable_close_balloon_for_testing = disable_close_balloon_for_testing;
+}
+
std::vector<BackgroundContents*>
BackgroundContentsService::GetBackgroundContents() const
{

Powered by Google App Engine
This is Rietveld 408576698