Commit 822d04b6 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Files app: Generate JS Module for //ui/file_manager/externs/background_window.js

Add JS module generation for:
//ui/file_manager/externs/background_window.js

Add the method forceFileOperationErrorForTest() in the interface
FileBrowserBackgroundFull and to its implementation
FileBrowserBackgroundFullImpl.  This is a preparation to run as JS
modules and as SWA; to avoid the integration test harness to reach to
global namespace `fileOperationUtil`.

Bug: 1133186
Change-Id: Ic5e2d38762b030c827c887021e7e611ba846228d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2537285
Auto-Submit: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarJeremie Boulic <jboulic@chromium.org>
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827714}
parent 089f5a3e
......@@ -18,6 +18,14 @@ js_library("file_manager_private") {
]
}
js_library("background_window.m") {
sources = [ "$root_gen_dir/ui/file_manager/externs/background_window.m.js" ]
deps = [ "//ui/file_manager/externs/background:background_base.m" ]
extra_deps = [ ":modulize" ]
}
js_library("entry_location.m") {
sources = [ "$root_gen_dir/ui/file_manager/externs/entry_location.m.js" ]
......@@ -95,6 +103,7 @@ js_library("volume_info_list.m") {
js_modulizer("modulize") {
input_files = [
"background_window.js",
"entry_location.js",
"files_app_entry_interfaces.js",
"metadata_worker_window.js",
......
......@@ -57,4 +57,10 @@ class FileBrowserBackgroundFull extends BackgroundBase {
* @param {function()} callback
*/
ready(callback) {}
/**
* Forces File Operation Util to return error for automated tests.
* @param {boolean} enable
*/
forceFileOperationErrorForTest(enable) {}
}
......@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// #import {BackgroundBase} from './background/background_base.m.js';
/**
* @constructor
* @extends {Window}
*/
class BackgroundWindow {
/* #export */ class BackgroundWindow {
constructor() {
/**
* For File Manager it uses FileBrowserBackgroundFull.
......
......@@ -140,6 +140,14 @@ class FileBrowserBackgroundImpl extends BackgroundBaseImpl {
this.initializationPromise_.then(callback);
}
/**
* Forces File Operation Util to return error for automated tests.
* @param {boolean} enable
*/
forceFileOperationErrorForTest(enable) {
fileOperationUtil.forceErrorForTest = enable;
}
/**
* Opens the volume root (or opt directoryPath) in main UI.
*
......
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