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

Side by Side Diff: remoting/webapp/js_proto/sinon_proto.js

Issue 1003433002: Updated remoting.xhr API to use promises. Removed access to the native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@spy-promise
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var sinon = sinon || {}; 5 var sinon = sinon || {};
6 6
7 /** @type {Object} */ 7 /** @type {Object} */
8 sinon.assert = {}; 8 sinon.assert = {};
9 9
10 /** 10 /**
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 sinon.Spy.prototype.called = false; 84 sinon.Spy.prototype.called = false;
85 85
86 /** @type {function(...):boolean} */ 86 /** @type {function(...):boolean} */
87 sinon.Spy.prototype.calledWith = function() {}; 87 sinon.Spy.prototype.calledWith = function() {};
88 88
89 /** @type {function(number):{args:Array}} */ 89 /** @type {function(number):{args:Array}} */
90 sinon.Spy.prototype.getCall = function(index) {}; 90 sinon.Spy.prototype.getCall = function(index) {};
91 91
92 sinon.Spy.prototype.reset = function() {}; 92 sinon.Spy.prototype.reset = function() {};
93 93
94 sinon.fakeServer = {};
95
96 /** @return {sinon.FakeXhr} */
97 sinon.useFakeXMLHttpRequest = function() {};
98
99 /** @interface */
100 sinon.FakeXhr = function() {};
101
102 /** @type {string} */
103 sinon.FakeXhr.prototype.method;
104
105 /** @type {string} */
106 sinon.FakeXhr.prototype.url;
107
108 /** @type {boolean} */
109 sinon.FakeXhr.prototype.withCredentials;
110
111 /** @type {?string} */
112 sinon.FakeXhr.prototype.requestBody;
113
114 /** @type {!Object<string,string>} */
115 sinon.FakeXhr.prototype.requestHeaders;
116
117 /**
118 * @param {number} status
119 * @param {!Object<string,string>} headers
120 * @param {?string} content
121 */
122 sinon.FakeXhr.prototype.respond;
123
124 /**
125 * @type {?function(!sinon.FakeXhr)}
126 */
127 sinon.FakeXhr.prototype.onCreate;
128
129 /** @return {sinon.FakeServer} */
130 sinon.fakeServer.create = function() {};
131
132 /** @interface */
133 sinon.FakeServer = function() {};
134
135 /**
136 * @param {*} a
137 * @param {*=} opt_b
138 * @param {*=} opt_c
139 * @return {void}
140 */
141 sinon.FakeServer.prototype.respondWith = function(a, opt_b, opt_c) {};
142
143 /**
144 * @return {void}
145 */
146 sinon.FakeServer.prototype.respond = function() {};
147
94 /** 148 /**
95 * @param {Object} obj 149 * @param {Object} obj
96 * @param {string} method 150 * @param {string} method
97 * @param {Function=} opt_stubFunction 151 * @param {Function=} opt_stubFunction
98 * @return {sinon.TestStub} 152 * @return {sinon.TestStub}
99 */ 153 */
100 sinon.stub = function(obj, method, opt_stubFunction) {}; 154 sinon.stub = function(obj, method, opt_stubFunction) {};
101 155
102 /** @constructor */ 156 /** @constructor */
103 sinon.TestStub = function() {}; 157 sinon.TestStub = function() {};
104 158
105 /** @type {function(number):{args:Array}} */ 159 /** @type {function(number):{args:Array}} */
106 sinon.TestStub.prototype.getCall = function(index) {}; 160 sinon.TestStub.prototype.getCall = function(index) {};
107 161
108 sinon.TestStub.prototype.restore = function() {}; 162 sinon.TestStub.prototype.restore = function() {};
109 163
110 /** @param {*} a */ 164 /** @param {*} a */
111 sinon.TestStub.prototype.returns = function(a) {}; 165 sinon.TestStub.prototype.returns = function(a) {};
112 166
113 /** @type {function(...):sinon.Expectation} */ 167 /** @type {function(...):sinon.Expectation} */
114 sinon.TestStub.prototype.withArgs = function() {}; 168 sinon.TestStub.prototype.withArgs = function() {};
115 169
116 /** @type {function(...):sinon.Expectation} */ 170 /** @type {function(...):sinon.Expectation} */
117 sinon.TestStub.prototype.onFirstCall = function() {}; 171 sinon.TestStub.prototype.onFirstCall = function() {};
118 172
119 /** @returns {Object} */ 173 /** @returns {Object} */
120 sinon.createStubInstance = function (/** * */ constructor) {}; 174 sinon.createStubInstance = function (/** * */ constructor) {};
OLDNEW
« remoting/webapp/crd/js/xhr.js ('K') | « remoting/webapp/js_proto/qunit_proto.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698