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

Unified Diff: remoting/webapp/externs/qunit.js

Issue 1196453003: chromoting: Add JS externs for qunit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't forget the gypi. Created 5 years, 6 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 | « remoting/webapp/build_template.gni ('k') | remoting/webapp/files.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/externs/qunit.js
diff --git a/remoting/webapp/js_proto/qunit_proto.js b/remoting/webapp/externs/qunit.js
similarity index 69%
copy from remoting/webapp/js_proto/qunit_proto.js
copy to remoting/webapp/externs/qunit.js
index ee535165c51da697647003c5477b65d758769c44..d804919cb20ae03fa4ced5944314546df6b54715 100644
--- a/remoting/webapp/js_proto/qunit_proto.js
+++ b/remoting/webapp/externs/qunit.js
@@ -2,40 +2,55 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file contains various hacks needed to inform JSCompiler of various
-// QUnit-specific properties and methods. It is used only with JSCompiler to
-// verify the type-correctness of our code.
+/**
+ * @fileoverview JSCompiler externs for QUnit.
+ * @externs
+ */
+/**
+ * namespace
+ * @const
+ */
+var QUnit = {};
-/** @type {Object} */
-var QUnit = QUnit || {};
-/** @constructor */
-QUnit.Test = function() {};
+/**
+ */
+QUnit.start = function() {};
-/** @type {QUnit.Clock} */
-QUnit.Test.prototype.clock = new QUnit.Clock();
-/** @constructor */
-QUnit.Clock = function() {};
+/**
+ */
+QUnit.stop = function() {};
+
+
+/**
+ * @param {string} name
+ * @param {function(!QUnit.Assert)} testFunction
+ */
+QUnit.test = function(name, testFunction) {};
-/** @param {number} ticks */
-QUnit.Clock.prototype.tick = function(ticks) {};
-/** @param {Function} f */
-QUnit.testStart = function(f) {};
-/** @param {Function} f */
-QUnit.testDone = function(f) {};
/**
- * @interface
+ * @constructor
*/
QUnit.Assert = function() {};
+
/**
- * @return {function():void}
+ * @param {number} assertionCount
*/
-QUnit.Assert.prototype.async = function() {};
+QUnit.Assert.prototype.expect = function(assertionCount) {};
+
+
+/** @constructor */
+QUnit.Clock = function() {};
+
+
+/** @param {number} ticks */
+QUnit.Clock.prototype.tick = function(ticks) {};
+
/**
* @param {*} a
@@ -44,38 +59,35 @@ QUnit.Assert.prototype.async = function() {};
*/
QUnit.Assert.prototype.notEqual = function(a, b, opt_desc) {};
-/**
- * @param {*} cond Passes if cond is truthy.
- * @param {string=} desc
- * @return {boolean}
- */
-QUnit.Assert.prototype.ok = function(cond, desc) {};
/**
* @param {*} a
* @param {*} b
* @param {string=} opt_message
*/
-QUnit.Assert.prototype.deepEqual = function(a, b, opt_message) {};
+QUnit.Assert.prototype.strictEqual = function(a, b, opt_message) {};
+
/**
- * @param {*} a
- * @param {*} b
+ * @param {boolean} condition
* @param {string=} opt_message
*/
-QUnit.Assert.prototype.equal = function(a, b, opt_message) {};
+QUnit.Assert.prototype.ok = function(condition, opt_message) {};
+
/**
- * @param {number} assertionCount
+ * @return {function():void}
*/
-QUnit.Assert.prototype.expect = function(assertionCount) {};
+QUnit.Assert.prototype.async = function() {};
+
/**
* @param {*} a
* @param {*} b
* @param {string=} opt_message
*/
-QUnit.Assert.prototype.strictEqual = function(a, b, opt_message) {};
+QUnit.Assert.prototype.deepEqual = function(a, b, opt_message) {};
+
/**
* @param {function()} a
@@ -84,6 +96,23 @@ QUnit.Assert.prototype.strictEqual = function(a, b, opt_message) {};
*/
QUnit.Assert.prototype.throws = function(a, opt_b, opt_message) {};
+
+/**
+ * @param {*} a
+ * @param {*} b
+ * @param {string=} opt_message
+ */
+QUnit.Assert.prototype.equal = function(a, b, opt_message) {};
+
+
+/** @param {Function} f */
+QUnit.testStart = function(f) {};
+
+
+/** @param {Function} f */
+QUnit.testDone = function(f) {};
+
+
/**
* @typedef {{
* beforeEach: (function(!QUnit.Assert) | undefined),
@@ -92,20 +121,9 @@ QUnit.Assert.prototype.throws = function(a, opt_b, opt_message) {};
*/
QUnit.ModuleArgs;
+
/**
* @param {string} desc
* @param {QUnit.ModuleArgs=} opt_args=
*/
QUnit.module = function(desc, opt_args) {};
-
-/**
- * @param {string} desc
- * @param {function(!QUnit.Assert)} f
- */
-QUnit.test = function(desc, f) {};
-
-/**
- * @param {string} desc
- * @param {function(!QUnit.Assert)} f
- */
-QUnit.skip = function(desc, f) {};
« no previous file with comments | « remoting/webapp/build_template.gni ('k') | remoting/webapp/files.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698