Index: chrome/test/data/file_manager/unit_tests/mocks/mock_file_operation_manager.js |
diff --git a/chrome/test/data/file_manager/unit_tests/mocks/mock_file_operation_manager.js b/chrome/test/data/file_manager/unit_tests/mocks/mock_file_operation_manager.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6d34d7daabe74af1853ff06c9465ccaf24320476 |
--- /dev/null |
+++ b/chrome/test/data/file_manager/unit_tests/mocks/mock_file_operation_manager.js |
@@ -0,0 +1,30 @@ |
+// Copyright 2013 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. |
+ |
+'use strict'; |
+ |
+/** |
+ * Mock class of FileOperationManager. |
+ * @constructor |
+ */ |
+function MockFileOperationManager() { |
+ cr.EventTarget.call(this); |
+ |
+ /** |
+ * Event to be dispatched when requestTaskCancel is called. |
+ * @type {Event} |
+ */ |
+ this.cancelEvent = null; |
+} |
+ |
+MockFileOperationManager.prototype = { |
+ __proto__: cr.EventTarget.prototype |
+}; |
+ |
+/** |
+ * Dispatches a pre-specified cancel event. |
+ */ |
+MockFileOperationManager.prototype.requestTaskCancel = function() { |
+ this.dispatchEvent(this.cancelEvent); |
+}; |