Chromium Code Reviews| 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..42e22473fd20f593b1b02b746f1164e77c7e1884 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,14 @@ void ExtensionBrowserTest::WaitForExtensionLoad() { |
| WaitForExtensionHostsToLoad(); |
| } |
| +bool ExtensionBrowserTest::WaitForExtensionLoadError() { |
| + int before = extension_load_errors_observed_; |
|
jstritar
2012/03/27 15:16:09
Is there a specific reason you need to count the e
miket_OOO
2012/03/28 17:28:47
I'm following the idiom established in the other W
|
| + ui_test_utils::RegisterAndWait(this, |
| + chrome::NOTIFICATION_EXTENSION_LOAD_ERROR, |
| + content::NotificationService::AllSources()); |
| + return extension_load_errors_observed_ != before; |
| +} |
| + |
| bool ExtensionBrowserTest::WaitForExtensionCrash( |
| const std::string& extension_id) { |
| ExtensionService* service = browser()->profile()->GetExtensionService(); |
| @@ -485,6 +494,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(); |