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

Unified Diff: chrome/browser/ui/webui/web_ui_test_handler.h

Issue 7576024: Provide ability for WebUIBrowserTests to run asynchronous tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments, fixed chrome.send passthrough, fixed assertion tests to use runTestFunction. Created 9 years, 4 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/ui/webui/web_ui_browsertest.cc ('k') | chrome/browser/ui/webui/web_ui_test_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f58b895fef156c7c5d9626591d71cdf9e21997d1 100644
--- a/chrome/browser/ui/webui/web_ui_test_handler.h
+++ b/chrome/browser/ui/webui/web_ui_test_handler.h
@@ -10,10 +10,18 @@
#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 {
public:
+ WebUITestHandler();
+
// Sends a message through |preload_host| with the |js_text| to preload at the
// appropriate time before the onload call is made.
void PreloadJavaScript(const string16& js_text,
@@ -29,21 +37,39 @@ class WebUITestHandler : public WebUIMessageHandler,
private:
// WebUIMessageHandler overrides.
// Add test handlers to the current WebUI object.
- virtual void RegisterMessages() OVERRIDE {}
+ virtual void RegisterMessages() OVERRIDE;
+
+ // Receives testResult messages.
+ void HandleTestResult(const base::ListValue* test_result);
// From NotificationObserver.
virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
- // Runs a message loop until test finishes. Returns the result of the test.
+ // Runs a message loop until test finishes. Returns the result of the
+ // test.
bool WaitForResult();
- // Pass fail result of current tests.
+ // Received test pass/fail;
+ bool test_done_;
+
+ // Pass fail result of current test.
bool test_succeeded_;
+ // Test code finished trying to execute. This will be set to true when the
+ // selected tab is done with this execution request whether it was able to
+ // parse/execute the javascript or not.
+ bool run_test_done_;
+
+ // Test code was able to execute successfully. This is *NOT* the test
+ // pass/fail.
+ bool run_test_succeeded_;
+
// Waiting for a test to finish.
bool is_waiting_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebUITestHandler);
};
#endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_TEST_HANDLER_H_
« no previous file with comments | « chrome/browser/ui/webui/web_ui_browsertest.cc ('k') | chrome/browser/ui/webui/web_ui_test_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698