Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / remoting / webapp / js_proto / sinon_proto.js
blob827d38d15592cf8d00f3ef46e99d09bd715b3091
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var sinon = sinon || {};
7 /** @type {Object} */
8 sinon.assert = {};
10 /**
11 * @param {(sinon.Spy|Function)} f
13 sinon.assert.called = function(f) {};
15 /**
16 * @param {(sinon.Spy|Function)} f
18 sinon.assert.calledOnce = function(f) {};
20 /**
21 * @param {(sinon.Spy|Function)} f
22 * @param {...} data
24 sinon.assert.calledWith = function(f, data) {};
26 /**
27 * @param {(sinon.Spy|Function)} f
29 sinon.assert.notCalled = function(f) {};
31 /** @constructor */
32 sinon.Expectation = function() {};
34 /** @return {sinon.Expectation} */
35 sinon.Expectation.prototype.once = function() {};
37 /**
38 * @param {...} data
39 * @return {sinon.Expectation}
41 sinon.Expectation.prototype.withArgs = function(data) {};
43 /** @return {boolean} */
44 sinon.Expectation.prototype.verify = function() {};
46 /** @param {...} data */
47 sinon.Expectation.prototype.returns = function(data) {};
49 /**
50 * @param {Object} obj
51 * @return {sinon.Mock}
53 sinon.mock = function(obj) {};
55 /** @constructor */
56 sinon.Mock = function() {};
58 /**
59 * @param {string} method
60 * @return {sinon.Expectation}
62 sinon.Mock.prototype.expects = function(method) {};
64 /**
65 * @return {void}
67 sinon.Mock.prototype.restore = function() {};
69 /** @type {function(...):Function} */
70 sinon.spy = function() {};
72 /**
73 * This is a jscompile type that can be OR'ed with the actual type to make
74 * jscompile aware of the sinon.spy functions that are added to the base
75 * type.
76 * Example: Instead of specifying a type of
77 * {function():void}
78 * the following can be used to add the sinon.spy functions:
79 * {(sinon.Spy|function():void)}
81 * @interface
83 sinon.Spy = function() {};
85 /** @type {number} */
86 sinon.Spy.prototype.callCount;
88 /** @type {boolean} */
89 sinon.Spy.prototype.called;
91 /** @type {boolean} */
92 sinon.Spy.prototype.calledOnce;
94 /** @type {boolean} */
95 sinon.Spy.prototype.calledTwice;
97 /** @type {function(...):boolean} */
98 sinon.Spy.prototype.calledWith = function() {};
100 /** @type {function(number):{args:Array}} */
101 sinon.Spy.prototype.getCall = function(index) {};
103 sinon.Spy.prototype.reset = function() {};
105 sinon.Spy.prototype.restore = function() {};
107 /** @type {Array<Array<*>>} */
108 sinon.Spy.prototype.args;
111 * @param {Object=} opt_obj
112 * @param {string=} opt_method
113 * @param {Function=} opt_stubFunction
114 * @return {sinon.TestStub}
116 sinon.stub = function(opt_obj, opt_method, opt_stubFunction) {};
119 * TODO(jrw): rename to |sinon.Stub| for consistency
120 * @interface
121 * @extends {sinon.Spy}
123 sinon.TestStub = function() {};
125 /** @type {function(number):{args:Array}} */
126 sinon.TestStub.prototype.getCall = function(index) {};
128 sinon.TestStub.prototype.restore = function() {};
130 /** @param {*} a */
131 sinon.TestStub.prototype.returns = function(a) {};
133 /** @type {function(...):sinon.Expectation} */
134 sinon.TestStub.prototype.withArgs = function() {};
136 /** @type {function(...):sinon.Expectation} */
137 sinon.TestStub.prototype.onFirstCall = function() {};
139 /** @type {function(...):sinon.Expectation} */
140 sinon.TestStub.prototype.callsArgWith = function() {};
142 /** @returns {Object} */
143 sinon.createStubInstance = function (/** * */ constructor) {};
145 /** @interface */
146 sinon.FakeXhrCtrl = function() {};
149 * @type {?function(!sinon.FakeXhr)}
151 sinon.FakeXhrCtrl.prototype.onCreate;
153 /** @return {sinon.FakeXhrCtrl} */
154 sinon.useFakeXMLHttpRequest = function() {};
156 /** @interface */
157 sinon.FakeXhr = function() {};
159 /** @type {number} */
160 sinon.FakeXhr.prototype.readyState;
162 /** @type {string} */
163 sinon.FakeXhr.prototype.method;
165 /** @type {string} */
166 sinon.FakeXhr.prototype.url;
168 /** @type {boolean} */
169 sinon.FakeXhr.prototype.withCredentials;
171 /** @type {?string} */
172 sinon.FakeXhr.prototype.requestBody;
174 /** @type {!Object<string,string>} */
175 sinon.FakeXhr.prototype.requestHeaders;
178 * @param {number} status
179 * @param {!Object<string,string>} headers
180 * @param {?string} content
182 sinon.FakeXhr.prototype.respond;
185 * @param {string} event
186 * @param {Function} handler
188 sinon.FakeXhr.prototype.addEventListener;