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

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

Issue 7576024: Provide ability for WebUIBrowserTests to run asynchronous tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Logic to handle multiple events coming on one RunMessageLoop() call. 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
Index: chrome/browser/ui/webui/web_ui_browsertest.h
diff --git a/chrome/browser/ui/webui/web_ui_browsertest.h b/chrome/browser/ui/webui/web_ui_browsertest.h
index 5e483e6d69f3c90ef6b8cca33f9275c31e659fe0..fa84ef11df024d748c000d254bd7dba763f4dbcf 100644
--- a/chrome/browser/ui/webui/web_ui_browsertest.h
+++ b/chrome/browser/ui/webui/web_ui_browsertest.h
@@ -72,6 +72,17 @@ class WebUIBrowserTest
bool RunJavascriptTest(const std::string& test_name,
const ConstValueVector& test_arguments);
+ // Runs a test that may include calls to functions in test_api.js, and waits
+ // for call to asyncTestDone().
+ bool RunJavascriptAsyncTest(const std::string& test_name);
+ bool RunJavascriptAsyncTest(const std::string& test_name,
+ const base::Value& arg);
+ bool RunJavascriptAsyncTest(const std::string& test_name,
+ const base::Value& arg1,
+ const base::Value& arg2);
+ bool RunJavascriptAsyncTest(const std::string& test_name,
+ const ConstValueVector& test_arguments);
+
// Sends message through |preload_host| to preload javascript libraries and
// sets the |libraries_preloaded| flag to prevent re-loading at next
// javascript invocation.
@@ -126,10 +137,12 @@ class WebUIBrowserTest
// logging an error message on failure, otherwise |function_name| is called
// asynchronously. When |preload_host| is non-NULL, sends the javascript to
// the RenderView for evaluation at the appropriate time before the onload
- // call is made.
+ // call is made. When |is_async| is true, waits for asyncTestDone() in
+ // javascript code.
bool RunJavascriptUsingHandler(const std::string& function_name,
const ConstValueVector& function_arguments,
bool is_test,
+ bool is_async,
RenderViewHost* preload_host);
// Attaches mock and test handlers.
« no previous file with comments | « no previous file | chrome/browser/ui/webui/web_ui_browsertest.cc » ('j') | chrome/browser/ui/webui/web_ui_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698