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

Unified Diff: chrome/browser/extensions/extension_apitest.h

Issue 276010: Remove the implicit wrench menu items for browser actions. (Closed)
Patch Set: Rebase Created 11 years, 2 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
« no previous file with comments | « chrome/browser/extensions/browser_action_test.cc ('k') | chrome/browser/extensions/extension_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_apitest.h
diff --git a/chrome/browser/extensions/extension_apitest.h b/chrome/browser/extensions/extension_apitest.h
index 466735dd6ea50296707d13733314580fd4c318b8..01ada82e8420baa0303b4850de7b84db4cb562eb 100644
--- a/chrome/browser/extensions/extension_apitest.h
+++ b/chrome/browser/extensions/extension_apitest.h
@@ -19,25 +19,42 @@
class ExtensionApiTest : public ExtensionBrowserTest {
protected:
+ // Helper class that observes tests failing or passing. Observation starts when
+ // the class is constructed. Get the next result by calling GetNextResult() and
+ // message() if GetNextResult() return false. If there are no results, this
+ // method will pump the UI message loop until one is received.
+ class ResultCatcher : public NotificationObserver {
+ public:
+ ResultCatcher();
+
+ // Pumps the UI loop until a notification is received that an API test
+ // succeeded or failed. Returns true if the test succeeded, false otherwise.
+ bool GetNextResult();
+
+ const std::string& message() { return message_; }
+
+ private:
+ virtual void Observe(NotificationType type, const NotificationSource& source,
+ const NotificationDetails& details);
+
+ NotificationRegistrar registrar_;
+
+ // A sequential list of pass/fail notifications from the test extension(s).
+ std::deque<bool> results_;
+
+ // If it failed, what was the error message?
+ std::deque<std::string> messages_;
+ std::string message_;
+ };
+
// Load |extension_name| and wait for pass / fail notification.
// |extension_name| is a directory in "test/data/extensions/api_test".
bool RunExtensionTest(const char* extension_name);
- // Reset |completed_| and wait for a new pass / fail notification.
- bool WaitForPassFail();
-
// All extensions tested by ExtensionApiTest are in the "api_test" dir.
virtual void SetUpCommandLine(CommandLine* command_line);
- // NotificationObserver
- void Observe(NotificationType type, const NotificationSource& source,
- const NotificationDetails& details);
-
- // A sequential list of pass/fail notifications from the test extension(s).
- std::deque<bool> results_;
-
// If it failed, what was the error message?
- std::deque<std::string> messages_;
std::string message_;
};
« no previous file with comments | « chrome/browser/extensions/browser_action_test.cc ('k') | chrome/browser/extensions/extension_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698