| Index: chrome/browser/ui/webui/web_ui_test_handler.h
|
| diff --git a/chrome/browser/ui/webui/web_ui_test_handler.h b/chrome/browser/ui/webui/web_ui_test_handler.h
|
| index 4c2ea3855b7ace2f4b05ca71bd24885379677902..e99df7d371f0c8a469bf8dd6cc7af3a59a47a170 100644
|
| --- a/chrome/browser/ui/webui/web_ui_test_handler.h
|
| +++ b/chrome/browser/ui/webui/web_ui_test_handler.h
|
| @@ -10,6 +10,12 @@
|
| #include "content/browser/webui/web_ui.h"
|
| #include "content/common/notification_observer.h"
|
|
|
| +namespace base {
|
| +
|
| +class ListValue;
|
| +
|
| +} // namespace base
|
| +
|
| // This class registers test framework specific handlers on WebUI objects.
|
| class WebUITestHandler : public WebUIMessageHandler,
|
| public NotificationObserver {
|
| @@ -26,10 +32,21 @@ class WebUITestHandler : public WebUIMessageHandler,
|
| // error message on failure. Returns test pass/fail.
|
| bool RunJavaScriptTestWithResult(const string16& js_text);
|
|
|
| + // Runs a message loop until async test finishes. Returns the result of the
|
| + // test.
|
| + bool WaitForAsyncResult();
|
| +
|
| private:
|
| // WebUIMessageHandler overrides.
|
| // Add test handlers to the current WebUI object.
|
| - virtual void RegisterMessages() OVERRIDE {}
|
| + virtual void RegisterMessages() OVERRIDE;
|
| +
|
| + // Receives asyncTestResult messages.
|
| + void HandleAsyncTestResult(const base::ListValue* test_result);
|
| +
|
| + // Populates |success| from |test_result|, logging messages to ERROR, upon
|
| + // failure.
|
| + void HandleTestResult(const base::ListValue* test_result, bool* success);
|
|
|
| // From NotificationObserver.
|
| virtual void Observe(int type,
|
| @@ -44,6 +61,15 @@ class WebUITestHandler : public WebUIMessageHandler,
|
|
|
| // Waiting for a test to finish.
|
| bool is_waiting_;
|
| +
|
| + // Received async completion pass/fail;
|
| + bool test_done_async_;
|
| +
|
| + // When |test_done_async_| is true, this is the pass/fail of the tests.
|
| + bool test_succeeded_async_;
|
| +
|
| + // Waiting for an async test to finish.
|
| + bool is_waiting_async_;
|
| };
|
|
|
| #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_TEST_HANDLER_H_
|
|
|