Index: remoting/webapp/unittests/sinon_helpers.js |
diff --git a/remoting/webapp/unittests/sinon_helpers.js b/remoting/webapp/unittests/sinon_helpers.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3fdc27be643477d037f86bbf6a352fb0143057b2 |
--- /dev/null |
+++ b/remoting/webapp/unittests/sinon_helpers.js |
@@ -0,0 +1,24 @@ |
+// Copyright 2014 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. |
+ |
+// This file contains various mock objects for the chrome platform to make |
kelvinp
2015/02/26 00:31:30
update comments
garykac
2015/02/28 02:33:33
Done.
|
+// unit testing easier. |
+ |
+var sinonHelpers = {}; |
+ |
+sinonHelpers.reset = function() { |
+ |
+/** |
+ * @param {Object} obj |
+ * @param {string} method |
+ * @return {sinon.$testStub} |
+ * @suppress {reportUnknownTypes} |
+ */ |
+sinon.$setupStub = function(obj, method) { |
+ sinon.stub(obj, method); |
+ obj[method].$testStub = /** @type {sinon.$testStub} */ (obj[method]); |
+ return obj[method].$testStub; |
+}; |
+ |
+}; |