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

Unified Diff: remoting/webapp/crd/js/mock_xhr.js

Issue 1065733004: Added partial unit tests for host_controller.js. More to come. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hdf-unittest
Patch Set: Created 5 years, 8 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/crd/js/mock_xhr.js
diff --git a/remoting/webapp/crd/js/mock_xhr.js b/remoting/webapp/crd/js/mock_xhr.js
index 706badbf82fbc69d44afc39953c51a52606a9ec2..4fa5954acd8e798e5ad2bbb490243fe7023f6f23 100644
--- a/remoting/webapp/crd/js/mock_xhr.js
+++ b/remoting/webapp/crd/js/mock_xhr.js
@@ -184,12 +184,14 @@ remoting.MockXhr.setResponseFor = function(
*
* @param {?string} method
* @param {?string|!RegExp} urlPattern
+ * @param {number=} opt_status
* @param {boolean=} opt_reuse
*/
-remoting.MockXhr.setEmptyResponseFor = function(method, urlPattern, opt_reuse) {
+remoting.MockXhr.setEmptyResponseFor = function(
+ method, urlPattern, opt_status, opt_reuse) {
remoting.MockXhr.setResponseFor(
method, urlPattern, function(/** remoting.MockXhr */ xhr) {
- xhr.setEmptyResponse(204);
+ xhr.setEmptyResponse(opt_status == null ? 204 : opt_status);
Jamie 2015/04/07 01:13:12 For the most common invocation, opt_status will be
John Williams 2015/04/07 20:10:26 In google3 I'd use goog.isDef, but here I've been
Jamie 2015/04/08 00:16:14 I guess the question here is whether or not we wan
}, opt_reuse);
};

Powered by Google App Engine
This is Rietveld 408576698