diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 06:59:22 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 06:59:22 +0000 |
commit | 80d6a44253e9e28bbb06a384d6249f1623e8b1e4 (patch) | |
tree | a581b4528f323ea84b5c8b5b6a92bc767096efa1 /chrome/browser/extensions/extension_apitest.h | |
parent | 83fe23a3ff26c5dea371ce94f6a909c4d081b145 (diff) | |
download | chromium_src-80d6a44253e9e28bbb06a384d6249f1623e8b1e4.zip chromium_src-80d6a44253e9e28bbb06a384d6249f1623e8b1e4.tar.gz chromium_src-80d6a44253e9e28bbb06a384d6249f1623e8b1e4.tar.bz2 |
Reland r29095 (removes wrench integration for
browser actions).
Test failure was a fluke. I forgot that changing
resources always makes the first bot run fail.
TBR=mpcomplete@chromium.org
BUG=24379,24671
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_apitest.h')
-rw-r--r-- | chrome/browser/extensions/extension_apitest.h | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/chrome/browser/extensions/extension_apitest.h b/chrome/browser/extensions/extension_apitest.h index 466735d..01ada82 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_; }; |