Index: chrome/browser/extensions/extension_browsertest.cc |
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc |
index c35ccb58585df5856bb431e15fdae527d7f5bb17..46d7accca6d3b61d8874ee585432edb56cd433de 100644 |
--- a/chrome/browser/extensions/extension_browsertest.cc |
+++ b/chrome/browser/extensions/extension_browsertest.cc |
@@ -36,6 +36,7 @@ ExtensionBrowserTest::ExtensionBrowserTest() |
: loaded_(false), |
installed_(false), |
extension_installs_observed_(0), |
+ extension_load_errors_observed_(0), |
target_page_action_count_(-1), |
target_visible_page_action_count_(-1) { |
EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); |
@@ -425,6 +426,15 @@ void ExtensionBrowserTest::WaitForExtensionLoad() { |
WaitForExtensionHostsToLoad(); |
} |
+bool ExtensionBrowserTest::WaitForExtensionLoadError() { |
+ int before = extension_load_errors_observed_; |
+ ui_test_utils::RegisterAndWait(this, |
+ chrome::NOTIFICATION_EXTENSION_LOAD_ERROR, |
+ content::NotificationService::AllSources()); |
+ WaitForExtensionHostsToLoad(); |
+ return extension_load_errors_observed_ != before; |
+} |
+ |
bool ExtensionBrowserTest::WaitForExtensionCrash( |
const std::string& extension_id) { |
ExtensionService* service = browser()->profile()->GetExtensionService(); |
@@ -485,6 +495,12 @@ void ExtensionBrowserTest::Observe( |
MessageLoopForUI::current()->Quit(); |
break; |
+ case chrome::NOTIFICATION_EXTENSION_LOAD_ERROR: |
+ VLOG(1) << "Got EXTENSION_LOAD_ERROR notification."; |
+ ++extension_load_errors_observed_; |
+ MessageLoopForUI::current()->Quit(); |
+ break; |
+ |
case chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED: { |
LocationBarTesting* location_bar = |
browser()->window()->GetLocationBar()->GetLocationBarForTesting(); |