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

Unified Diff: third_party/WebKit/Source/devtools/front_end/common/TestBase.js

Issue 1704723002: DevTools: add input event instrumentation test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: speculative attempt to fix MacOS 10.6 flakiness Created 4 years, 10 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: third_party/WebKit/Source/devtools/front_end/common/TestBase.js
diff --git a/third_party/WebKit/Source/devtools/front_end/common/TestBase.js b/third_party/WebKit/Source/devtools/front_end/common/TestBase.js
index 5b9cb4bef726aebb7b0bc36403ca1189ca5dbb55..48fecf7b697d0870db5d3949e70af6ad0db2556f 100644
--- a/third_party/WebKit/Source/devtools/front_end/common/TestBase.js
+++ b/third_party/WebKit/Source/devtools/front_end/common/TestBase.js
@@ -79,6 +79,7 @@ WebInspector.TestBase.prototype.releaseControl = function()
clearTimeout(this.timerId_);
this.timerId_ = -1;
}
+ this.controlTaken_ = false;
this.reportOk_();
};
@@ -107,7 +108,7 @@ WebInspector.TestBase.prototype.reportFailure_ = function(error)
/**
* Run specified test on a fresh instance of the test suite.
- * @param {string} name Name of a test method from implementation class.
+ * @param {Array<string>} args method name followed by its parameters.
*/
WebInspector.TestBase.prototype.dispatch = function(args)
{
@@ -123,6 +124,19 @@ WebInspector.TestBase.prototype.dispatch = function(args)
/**
+ * Wrap an async method with TestBase.{takeControl(), releaseControl()}
+ * and invoke TestBase.reportOk_ upon completion.
+ * @param {Array<string>} args method name followed by its parameters.
+ */
+WebInspector.TestBase.prototype.waitForAsync = function(var_args)
+{
+ var args = Array.prototype.slice.call(arguments);
+ this.takeControl();
+ args.push(this.releaseControl.bind(this));
+ this.dispatch(args);
+};
+
+/**
* Overrides the method with specified name until it's called first time.
* @param {!Object} receiver An object whose method to override.
* @param {string} methodName Name of the method to override.
« no previous file with comments | « chrome/test/data/devtools/latency_info.html ('k') | third_party/WebKit/Source/devtools/front_end/main/Tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698