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

Unified Diff: remoting/webapp/js_proto/sinon_proto.js

Issue 959963002: [Chromoting] Enable jscompile for webapp unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename sinon.$testStub -> sinon.TestStub Created 5 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: remoting/webapp/js_proto/sinon_proto.js
diff --git a/remoting/webapp/js_proto/sinon_proto.js b/remoting/webapp/js_proto/sinon_proto.js
new file mode 100644
index 0000000000000000000000000000000000000000..bc39ea5146171e52e34ccc60bc45b3db7fa7c422
--- /dev/null
+++ b/remoting/webapp/js_proto/sinon_proto.js
@@ -0,0 +1,113 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var sinon = sinon || {};
+
+/** @type {Object} */
+sinon.assert = {};
+
+/**
+ * @param {(sinon.Spy|Function)} f
+ */
+sinon.assert.called = function(f) {};
+
+/**
+ * @param {(sinon.Spy|Function)} f
+ */
+sinon.assert.calledOnce = function(f) {};
+
+/**
+ * @param {(sinon.Spy|Function)} f
+ * @param {...} data
+ */
+sinon.assert.calledWith = function(f, data) {};
+
+/**
+ * @param {(sinon.Spy|Function)} f
+ */
+sinon.assert.notCalled = function(f) {};
+
+/** @constructor */
+sinon.Expectation = function() {};
+
+/** @return {sinon.Expectation} */
+sinon.Expectation.prototype.once = function() {};
+
+/**
+ * @param {...} data
+ * @return {sinon.Expectation}
+ */
+sinon.Expectation.prototype.withArgs = function(data) {};
+
+/** @return {boolean} */
+sinon.Expectation.prototype.verify = function() {};
+
+/** @param {...} data */
+sinon.Expectation.prototype.returns = function(data) {};
+
+/**
+ * @param {Object} obj
+ * @return {sinon.Mock}
+ */
+sinon.mock = function(obj) {};
+
+/** @constructor */
+sinon.Mock = function() {};
+
+/**
+ * @param {string} method
+ * @return {sinon.Expectation}
+ */
+sinon.Mock.prototype.expects = function(method) {};
+
+/** @type {function(...):Function} */
+sinon.spy = function() {};
+
+/**
+ * This is a jscompile type that can be OR'ed with the actual type to make
+ * jscompile aware of the sinon.spy functions that are added to the base
+ * type.
+ * Example: Instead of specifying a type of
+ * {function():void}
+ * the following can be used to add the sinon.spy functions:
+ * {(sinon.Spy|function():void)}
+ *
+ * @constructor
+ */
+sinon.Spy = function() {};
+
+/** @type {number} */
+sinon.Spy.prototype.callCount;
+
+/** @type {boolean} */
+sinon.Spy.prototype.called = false;
+
+/** @type {function(...):boolean} */
+sinon.Spy.prototype.calledWith = function() {};
+
+/** @type {function(number):{args:Array}} */
+sinon.Spy.prototype.getCall = function(index) {};
+
+sinon.Spy.prototype.reset = function() {};
+
+/**
+ * @param {Object} obj
+ * @param {string} method
+ * @return {sinon.TestStub}
+ */
+sinon.stub = function(obj, method) {};
+
+/** @constructor */
+sinon.TestStub = function() {};
+
+/** @type {function(number):{args:Array}} */
+sinon.TestStub.prototype.getCall = function(index) {};
+
+sinon.TestStub.prototype.restore = function() {};
+
+/** @param {*} a */
+sinon.TestStub.prototype.returns = function(a) {};
+
+/** @type {function(string, (string|Array<string>)=):sinon.Expectation} */
+sinon.TestStub.prototype.withArgs = function(messageName, opt_args) {};

Powered by Google App Engine
This is Rietveld 408576698