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

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: 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 | « .gitignore ('k') | chrome/browser/ui/webui/web_ui_browsertest.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_browsertest.h
diff --git a/chrome/browser/ui/webui/web_ui_browsertest.h b/chrome/browser/ui/webui/web_ui_browsertest.h
index 5e483e6d69f3c90ef6b8cca33f9275c31e659fe0..13b2c4096acdb3c0b527b00a2f21d71404b94ea1 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.
@@ -116,8 +127,9 @@ class WebUIBrowserTest
void BuildJavascriptLibraries(string16* content);
// Builds a string with a call to the runTest JS function, passing the
- // given test and its arguments.
- string16 BuildRunTestJSCall(const std::string& test_name,
+ // given |is_async|, |test_name| and its |args|.
+ string16 BuildRunTestJSCall(bool is_async,
+ const std::string& test_name,
const WebUIBrowserTest::ConstValueVector& args);
// Loads all libraries added with AddLibrary(), and calls |function_name| with
@@ -126,10 +138,11 @@ 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. Passes |is_async| along to runTest wrapper.
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 | « .gitignore ('k') | chrome/browser/ui/webui/web_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698