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

Unified Diff: chrome/browser/extensions/extension_browsertest.cc

Issue 9839105: Expand usage of platform-apps flag and permission features. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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/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();

Powered by Google App Engine
This is Rietveld 408576698