Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / file_manager / unit_tests / mocks / mock_file_operation_manager.js
1 // Copyright 2013 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.
4
5 'use strict';
6
7 /**
8  * Mock class of FileOperationManager.
9  * @constructor
10  */
11 function MockFileOperationManager() {
12   cr.EventTarget.call(this);
13
14   /**
15    * Event to be dispatched when requestTaskCancel is called.
16    * @type {Event}
17    */
18   this.cancelEvent = null;
19 }
20
21 MockFileOperationManager.prototype = {
22   __proto__: cr.EventTarget.prototype
23 };
24
25 /**
26  * Dispatches a pre-specified cancel event.
27  */
28 MockFileOperationManager.prototype.requestTaskCancel = function() {
29   this.dispatchEvent(this.cancelEvent);
30 };