Commit f6146e18 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Chromium LUCI CQ

Files app: Generate JS module for Files app background page

Generate JS modules for most of the mocks in:
//ui/file_manager/file_manager/background/js/

Files in //ui/file_manager/file_manager/background/js/:
crostini.js
mock_crostini.js
crostini_unittest.m.js
mock_drive_sync_handler.js
mock_file_operation_manager.js
mock_progress_center.js

Files in //ui/file_manager/externs/:
progress_center_panel.js
background/crostini.js
background/drive_sync_handler.js
background/file_operation_manager.js
background/progress_center.js

Bug: 1133186
Change-Id: I12d665f413d9965bd5ef5d8db7f93d724fdfbea6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2589234
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Reviewed-by: default avatarJeremie Boulic <jboulic@chromium.org>
Auto-Submit: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836904}
parent 19aeffd4
...@@ -38,7 +38,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, ContentMetadataProvider) { ...@@ -38,7 +38,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, ContentMetadataProvider) {
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, Crostini) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, Crostini) {
RunTestURL("background/js/crostini_unittest_gen.html"); RunTestURL("background/js/crostini_unittest.m_gen.html");
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, DeviceHandlerTest) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, DeviceHandlerTest) {
......
...@@ -64,6 +64,14 @@ js_library("metadata_worker_window.m") { ...@@ -64,6 +64,14 @@ js_library("metadata_worker_window.m") {
extra_deps = [ ":modulize" ] extra_deps = [ ":modulize" ]
} }
js_library("progress_center_panel.m") {
sources =
[ "$root_gen_dir/ui/file_manager/externs/progress_center_panel.m.js" ]
deps = [ "//ui/file_manager/file_manager/common/js:progress_center_common.m" ]
extra_deps = [ ":modulize" ]
}
js_library("volume_manager") { js_library("volume_manager") {
sources = [] sources = []
...@@ -118,6 +126,7 @@ js_modulizer("modulize") { ...@@ -118,6 +126,7 @@ js_modulizer("modulize") {
"exif_entry.js", "exif_entry.js",
"files_app_entry_interfaces.js", "files_app_entry_interfaces.js",
"metadata_worker_window.js", "metadata_worker_window.js",
"progress_center_panel.js",
"volume_info.js", "volume_info.js",
"volume_info_list.js", "volume_info_list.js",
"volume_manager.js", "volume_manager.js",
......
...@@ -35,6 +35,49 @@ js_library("background_base.m") { ...@@ -35,6 +35,49 @@ js_library("background_base.m") {
extra_deps = [ ":modulize" ] extra_deps = [ ":modulize" ]
} }
js_library("drive_sync_handler.m") {
sources = [
"$root_gen_dir/ui/file_manager/externs/background/drive_sync_handler.m.js",
]
extra_deps = [ ":modulize" ]
}
js_library("crostini.m") {
sources = [ "$root_gen_dir/ui/file_manager/externs/background/crostini.m.js" ]
deps = [ "..:volume_manager.m" ]
extra_deps = [ ":modulize" ]
}
js_library("file_operation_manager.m") {
sources = [ "$root_gen_dir/ui/file_manager/externs/background/file_operation_manager.m.js" ]
deps = [
"..:files_app_entry_interfaces.m",
"..:volume_manager.m",
]
extra_deps = [ ":modulize" ]
}
js_library("progress_center.m") {
sources = [
"$root_gen_dir/ui/file_manager/externs/background/progress_center.m.js",
]
deps = [
"..:progress_center_panel.m",
"//ui/file_manager/file_manager/common/js:progress_center_common.m",
]
extra_deps = [ ":modulize" ]
}
js_modulizer("modulize") { js_modulizer("modulize") {
input_files = [ "background_base.js" ] input_files = [
"background_base.js",
"crostini.js",
"drive_sync_handler.js",
"file_operation_manager.js",
"progress_center.js",
]
} }
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// #import {VolumeManager} from '../volume_manager.m.js';
/** /**
* Crostini shared path state handler. * Crostini shared path state handler.
* *
* @interface * @interface
*/ */
class Crostini { /* #export */ class Crostini {
/** /**
* Initialize enabled settings. * Initialize enabled settings.
* Must be done after loadTimeData is available. * Must be done after loadTimeData is available.
...@@ -66,7 +68,7 @@ class Crostini { ...@@ -66,7 +68,7 @@ class Crostini {
* Returns true if entry can be shared with the specified VM. * Returns true if entry can be shared with the specified VM.
* @param {string} vmName * @param {string} vmName
* @param {!Entry} entry * @param {!Entry} entry
* @param {boolean} persist If path is to be persisted. * @return {boolean} persist If path is to be persisted.
*/ */
canSharePath(vmName, entry, persist) {} canSharePath(vmName, entry, persist) {}
} }
...@@ -7,9 +7,8 @@ ...@@ -7,9 +7,8 @@
* of this interface must @extends {cr.EventTarget}. * of this interface must @extends {cr.EventTarget}.
* *
* @interface * @interface
* @extends {EventTarget}
*/ */
class DriveSyncHandler extends EventTarget { /* #export */ class DriveSyncHandler extends EventTarget {
/** /**
* Returns the completed event name. * Returns the completed event name.
* @return {string} * @return {string}
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// #import {VolumeManager} from '../volume_manager.m.js';
// #import {FilesAppEntry, FakeEntry} from '../files_app_entry_interfaces.m.js';
/** /**
* FileOperationManager: manager of file operations. Implementations of this * FileOperationManager: manager of file operations. Implementations of this
* interface must @extends {cr.EventTarget} or implement the EventTarget API on * interface must @extends {cr.EventTarget} or implement the EventTarget API on
...@@ -9,7 +12,7 @@ ...@@ -9,7 +12,7 @@
* *
* @interface * @interface
*/ */
class FileOperationManager extends EventTarget { /* #export */ class FileOperationManager extends EventTarget {
/** /**
* Says if there are any tasks in the queue. * Says if there are any tasks in the queue.
* @return {boolean} True, if there are any tasks. * @return {boolean} True, if there are any tasks.
......
...@@ -2,11 +2,16 @@ ...@@ -2,11 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// clang-format off
// #import {ProgressCenterItem} from '../../file_manager/common/js/progress_center_common.m.js';
// #import {ProgressCenterPanelInterface} from '../progress_center_panel.m.js';
// clang-format on
/** /**
* Progress center at the background page. * Progress center at the background page.
* @interface * @interface
*/ */
class ProgressCenter { /* #export */ class ProgressCenter {
/** /**
* Turns off sending updates when a file operation reaches 'completed' state. * Turns off sending updates when a file operation reaches 'completed' state.
* Used for testing UI that can be ephemeral otherwise. * Used for testing UI that can be ephemeral otherwise.
......
...@@ -2,13 +2,17 @@ ...@@ -2,13 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// clang-format off
// #import {ProgressCenterItem, ProgressItemState} from '../file_manager/common/js/progress_center_common.m.js';
// clang-format on
/** /**
* Interface implemented in foreground page that the background page uses to * Interface implemented in foreground page that the background page uses to
* send progress event updates to the foreground page, and to receive cancel * send progress event updates to the foreground page, and to receive cancel
* and dismiss events from the foreground page. * and dismiss events from the foreground page.
* @interface * @interface
*/ */
class ProgressCenterPanelInterface { /* #export */ class ProgressCenterPanelInterface {
constructor() { constructor() {
/** /**
* Callback to be called with the ID of the progress item when the cancel * Callback to be called with the ID of the progress item when the cancel
......
...@@ -76,9 +76,13 @@ js_type_check("closure_compile_jsmodules") { ...@@ -76,9 +76,13 @@ js_type_check("closure_compile_jsmodules") {
":app_window_wrapper.m", ":app_window_wrapper.m",
":app_windows.m", ":app_windows.m",
":background_base.m", ":background_base.m",
":crostini.m",
":entry_location_impl.m", ":entry_location_impl.m",
":file_operation_util.m", ":file_operation_util.m",
":metadata_proxy.m", ":metadata_proxy.m",
":mock_drive_sync_handler.m",
":mock_file_operation_manager.m",
":mock_progress_center.m",
":test_util_base.m", ":test_util_base.m",
":volume_info_impl.m", ":volume_info_impl.m",
":volume_info_list_impl.m", ":volume_info_list_impl.m",
...@@ -91,7 +95,10 @@ js_type_check("closure_compile_jsmodules") { ...@@ -91,7 +95,10 @@ js_type_check("closure_compile_jsmodules") {
js_type_check("test_support_modules_type_check") { js_type_check("test_support_modules_type_check") {
testonly = true testonly = true
uses_js_modules = true uses_js_modules = true
deps = [ ":mock_volume_manager.m" ] deps = [
":mock_crostini.m",
":mock_volume_manager.m",
]
} }
js_type_check("test_support_type_check") { js_type_check("test_support_type_check") {
...@@ -224,6 +231,21 @@ js_library("crostini") { ...@@ -224,6 +231,21 @@ js_library("crostini") {
externs_list = [ "//ui/file_manager/externs/background/crostini.js" ] externs_list = [ "//ui/file_manager/externs/background/crostini.js" ]
} }
js_library("crostini.m") {
sources = [
"$root_gen_dir/ui/file_manager/file_manager/background/js/crostini.m.js",
]
deps = [
"//ui/file_manager/base/js:volume_manager_types.m",
"//ui/file_manager/externs:volume_manager.m",
"//ui/file_manager/externs/background:crostini.m",
"//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js:load_time_data.m",
]
extra_deps = [ ":modulize" ]
}
js_library("mock_crostini") { js_library("mock_crostini") {
testonly = true testonly = true
deps = [ ":crostini" ] deps = [ ":crostini" ]
...@@ -232,11 +254,27 @@ js_library("mock_crostini") { ...@@ -232,11 +254,27 @@ js_library("mock_crostini") {
visibility = [ "//ui/file_manager/file_manager/*" ] visibility = [ "//ui/file_manager/file_manager/*" ]
} }
js_unittest("crostini_unittest") { js_library("mock_crostini.m") {
testonly = true
sources = [ "$root_gen_dir/ui/file_manager/file_manager/background/js/mock_crostini.m.js" ]
deps = [ deps = [
":mock_crostini", ":crostini.m",
"//ui/file_manager/file_manager/common/js:mock_entry", "//ui/file_manager/externs/background:crostini.m",
"//ui/webui/resources/js:webui_resource_test", ]
extra_deps = [ ":modulize" ]
}
js_unittest("crostini_unittest.m") {
deps = [
":mock_crostini.m",
"//chrome/test/data/webui:chai_assert",
"//ui/file_manager/base/js:volume_manager_types.m",
"//ui/file_manager/externs:entry_location.m",
"//ui/file_manager/externs:volume_manager.m",
"//ui/file_manager/externs/background:crostini.m",
"//ui/file_manager/file_manager/common/js:mock_entry.m",
"//ui/webui/resources/js:load_time_data.m",
] ]
} }
...@@ -272,6 +310,16 @@ js_library("mock_drive_sync_handler") { ...@@ -272,6 +310,16 @@ js_library("mock_drive_sync_handler") {
visibility = [ "//ui/file_manager/file_manager/*" ] visibility = [ "//ui/file_manager/file_manager/*" ]
} }
js_library("mock_drive_sync_handler.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/background/js/mock_drive_sync_handler.m.js" ]
deps = [
"//ui/file_manager/externs/background:drive_sync_handler.m",
"//ui/webui/resources/js/cr:event_target.m",
]
extra_deps = [ ":modulize" ]
}
js_library("drive_sync_handler") { js_library("drive_sync_handler") {
deps = [ deps = [
":progress_center", ":progress_center",
...@@ -357,6 +405,17 @@ js_library("mock_file_operation_manager") { ...@@ -357,6 +405,17 @@ js_library("mock_file_operation_manager") {
[ "//ui/file_manager/externs/background/file_operation_manager.js" ] [ "//ui/file_manager/externs/background/file_operation_manager.js" ]
} }
js_library("mock_file_operation_manager.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/background/js/mock_file_operation_manager.m.js" ]
deps = [
"//ui/file_manager/externs/background:file_operation_manager.m",
"//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js/cr:event_target.m",
]
extra_deps = [ ":modulize" ]
}
js_library("file_operation_manager") { js_library("file_operation_manager") {
deps = [ deps = [
":file_operation_util", ":file_operation_util",
...@@ -563,6 +622,16 @@ js_library("mock_progress_center") { ...@@ -563,6 +622,16 @@ js_library("mock_progress_center") {
[ "//ui/file_manager/file_manager/foreground/js:file_tasks_unittest" ] [ "//ui/file_manager/file_manager/foreground/js:file_tasks_unittest" ]
} }
js_library("mock_progress_center.m") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/background/js/mock_progress_center.m.js" ]
deps = [
"//ui/file_manager/externs/background:progress_center.m",
"//ui/file_manager/file_manager/common/js:progress_center_common.m",
]
extra_deps = [ ":modulize" ]
}
js_library("progress_center") { js_library("progress_center") {
deps = [ deps = [
"//ui/file_manager/file_manager/common/js:async_util", "//ui/file_manager/file_manager/common/js:async_util",
...@@ -799,7 +868,10 @@ js_library("volume_manager_util.m") { ...@@ -799,7 +868,10 @@ js_library("volume_manager_util.m") {
} }
js_test_gen_html("js_test_gen_html_modules") { js_test_gen_html("js_test_gen_html_modules") {
deps = [ ":metadata_proxy_unittest.m" ] deps = [
":crostini_unittest.m",
":metadata_proxy_unittest.m",
]
js_module = true js_module = true
closure_flags = closure_flags =
...@@ -813,7 +885,6 @@ js_test_gen_html("js_test_gen_html_modules") { ...@@ -813,7 +885,6 @@ js_test_gen_html("js_test_gen_html_modules") {
js_test_gen_html("js_test_gen_html") { js_test_gen_html("js_test_gen_html") {
deps = [ deps = [
":crostini_unittest",
":device_handler_unittest", ":device_handler_unittest",
":drive_sync_handler_unittest", ":drive_sync_handler_unittest",
":duplicate_finder_unittest", ":duplicate_finder_unittest",
...@@ -844,6 +915,11 @@ js_modulizer("modulize") { ...@@ -844,6 +915,11 @@ js_modulizer("modulize") {
"volume_manager_impl.js", "volume_manager_impl.js",
"volume_manager_util.js", "volume_manager_util.js",
"file_operation_util.js", "file_operation_util.js",
"mock_drive_sync_handler.js",
"mock_crostini.js",
"crostini.js",
"mock_file_operation_manager.js",
"mock_progress_center.js",
] ]
namespace_rewrites = cr_namespace_rewrites namespace_rewrites = cr_namespace_rewrites
......
...@@ -2,12 +2,20 @@ ...@@ -2,12 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// clang-format off
// #import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
// #import {assert} from 'chrome://resources/js/assert.m.js';
// #import {VolumeManagerCommon} from '../../../base/js/volume_manager_types.m.js';
// #import {Crostini} from '../../../externs/background/crostini.m.js';
// #import {VolumeManager} from '../../../externs/volume_manager.m.js';
// clang-format on
/** /**
* Implementation of Crostini shared path state handler. * Implementation of Crostini shared path state handler.
* *
* @implements {Crostini} * @implements {Crostini}
*/ */
class CrostiniImpl { /* #export */ class CrostiniImpl {
constructor() { constructor() {
/** /**
* True if VM is enabled. * True if VM is enabled.
...@@ -189,7 +197,7 @@ class CrostiniImpl { ...@@ -189,7 +197,7 @@ class CrostiniImpl {
* Returns true if entry can be shared with the specified VM. * Returns true if entry can be shared with the specified VM.
* @param {string} vmName * @param {string} vmName
* @param {!Entry} entry * @param {!Entry} entry
* @param {boolean} persist If path is to be persisted. * @return {boolean} persist If path is to be persisted.
*/ */
canSharePath(vmName, entry, persist) { canSharePath(vmName, entry, persist) {
if (!this.enabled_[vmName]) { if (!this.enabled_[vmName]) {
......
...@@ -2,7 +2,18 @@ ...@@ -2,7 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
'use strict'; // clang-format off
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
import { assertFalse,assertTrue} from 'chrome://test/chai_assert.js';
import {VolumeManagerCommon} from '../../../base/js/volume_manager_types.m.js';
import {Crostini} from '../../../externs/background/crostini.m.js';
import {EntryLocation} from '../../../externs/entry_location.m.js';
import {VolumeManager} from '../../../externs/volume_manager.m.js';
import { MockDirectoryEntry, MockEntry,MockFileSystem} from '../../common/js/mock_entry.m.js';
import {createCrostiniForTest} from './mock_crostini.m.js';
// clang-format on
/** /**
* Mock metrics. * Mock metrics.
...@@ -22,15 +33,13 @@ let volumeManager; ...@@ -22,15 +33,13 @@ let volumeManager;
let crostini; let crostini;
// Set up the test components. // Set up the test components.
function setUp() { export function setUp() {
// Mock LoadTimeData strings. // Mock LoadTimeData strings.
window.loadTimeData = { loadTimeData.data = {};
data: {}, loadTimeData.getBoolean = function(key) {
getBoolean: function(key) { return loadTimeData.data_[key];
return window.loadTimeData.data[key];
},
getString: id => id,
}; };
loadTimeData.getString = id => id;
// Create a fake volume manager that provides entry location info. // Create a fake volume manager that provides entry location info.
volumeManager = /** @type {!VolumeManager} */ ({ volumeManager = /** @type {!VolumeManager} */ ({
...@@ -53,15 +62,15 @@ function setUp() { ...@@ -53,15 +62,15 @@ function setUp() {
/** /**
* Tests init sets crostini and PluginVm enabled status. * Tests init sets crostini and PluginVm enabled status.
*/ */
function testInitCrostiniPluginVmEnabled() { export function testInitCrostiniPluginVmEnabled() {
window.loadTimeData.data['CROSTINI_ENABLED'] = true; loadTimeData.data_['CROSTINI_ENABLED'] = true;
window.loadTimeData.data['PLUGIN_VM_ENABLED'] = true; loadTimeData.data_['PLUGIN_VM_ENABLED'] = true;
crostini.initEnabled(); crostini.initEnabled();
assertTrue(crostini.isEnabled('termina')); assertTrue(crostini.isEnabled('termina'));
assertTrue(crostini.isEnabled('PvmDefault')); assertTrue(crostini.isEnabled('PvmDefault'));
window.loadTimeData.data['CROSTINI_ENABLED'] = false; loadTimeData.data_['CROSTINI_ENABLED'] = false;
window.loadTimeData.data['PLUGIN_VM_ENABLED'] = false; loadTimeData.data_['PLUGIN_VM_ENABLED'] = false;
crostini.initEnabled(); crostini.initEnabled();
assertFalse(crostini.isEnabled('termina')); assertFalse(crostini.isEnabled('termina'));
assertFalse(crostini.isEnabled('PvmDefault')); assertFalse(crostini.isEnabled('PvmDefault'));
...@@ -70,7 +79,7 @@ function testInitCrostiniPluginVmEnabled() { ...@@ -70,7 +79,7 @@ function testInitCrostiniPluginVmEnabled() {
/** /**
* Tests path sharing. * Tests path sharing.
*/ */
function testIsPathShared() { export function testIsPathShared() {
const mockFileSystem = new MockFileSystem('volumeId'); const mockFileSystem = new MockFileSystem('volumeId');
const root = MockDirectoryEntry.create(mockFileSystem, '/'); const root = MockDirectoryEntry.create(mockFileSystem, '/');
const a = MockDirectoryEntry.create(mockFileSystem, '/a'); const a = MockDirectoryEntry.create(mockFileSystem, '/a');
...@@ -143,7 +152,7 @@ function testIsPathShared() { ...@@ -143,7 +152,7 @@ function testIsPathShared() {
/* /*
* Tests disallowed and allowed shared paths. * Tests disallowed and allowed shared paths.
*/ */
function testCanSharePath() { export function testCanSharePath() {
crostini.setEnabled('vm', true); crostini.setEnabled('vm', true);
const mockFileSystem = new MockFileSystem('test'); const mockFileSystem = new MockFileSystem('test');
......
...@@ -2,13 +2,16 @@ ...@@ -2,13 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
'use strict'; // #import {CrostiniImpl} from './crostini.m.js';
// #import {Crostini} from '../../../externs/background/crostini.m.js';
/* #ignore */ 'use strict';
/** /**
* Crostini shared path state handler factory for foreground tests. Change it * Crostini shared path state handler factory for foreground tests. Change it
* to a mock when tests need to override {CrostiniImpl} behavior. * to a mock when tests need to override {CrostiniImpl} behavior.
* @return {!Crostini} * @return {!Crostini}
*/ */
function createCrostiniForTest() { /* #export */ function createCrostiniForTest() {
return new CrostiniImpl(); return new CrostiniImpl();
} }
...@@ -2,13 +2,18 @@ ...@@ -2,13 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
'use strict'; // clang-format off
// #import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js';
// #import {DriveSyncHandler} from '../../../externs/background/drive_sync_handler.m.js';
// clang-format on
/* #ignore */ 'use strict';
/** /**
* Mock of DriveSyncHandler. * Mock of DriveSyncHandler.
* @implements {DriveSyncHandler} * @implements {DriveSyncHandler}
*/ */
class MockDriveSyncHandler extends cr.EventTarget { /* #export */ class MockDriveSyncHandler extends cr.EventTarget {
constructor() { constructor() {
super(); super();
......
...@@ -2,13 +2,19 @@ ...@@ -2,13 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
'use strict'; // clang-format off
// #import {assert} from 'chrome://resources/js/assert.m.js';
// #import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js';
// #import {FileOperationManager} from '../../../externs/background/file_operation_manager.m.js';
// clang-format on
/* #ignore */ 'use strict';
/** /**
* Mock implementation of {FileOperationManager} for tests. * Mock implementation of {FileOperationManager} for tests.
* @implements {FileOperationManager} * @implements {FileOperationManager}
*/ */
class MockFileOperationManager extends cr.EventTarget { /* #export */ class MockFileOperationManager extends cr.EventTarget {
constructor() { constructor() {
super(); super();
......
// Copyright 2013 The Chromium Authors. All rights reserved. // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
'use strict';
/* #ignore */ 'use strict';
// clang-format off
// #import {ProgressCenterItem, ProgressItemState} from '../../common/js/progress_center_common.m.js';
// #import {ProgressCenter} from '../../../externs/background/progress_center.m.js';
// clang-format on
/** /**
* Mock implementation of {ProgressCenter} for tests. * Mock implementation of {ProgressCenter} for tests.
* @implements {ProgressCenter} * @implements {ProgressCenter}
* @final * @final
*/ */
class MockProgressCenter { /* #export */ class MockProgressCenter {
constructor() { constructor() {
/** /**
* Items stored in the progress center. * Items stored in the progress center.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment