Commit 6c569aa7 authored by Jeremie Boulic's avatar Jeremie Boulic Committed by Chromium LUCI CQ

Revert "[Files app] Generate modules for ui/file_manager/.../metadata_proxy.js"

This reverts commit 9d2bdda8.

Reason for revert: Unwanted code submitted with this change.

Original change's description:
> [Files app] Generate modules for ui/file_manager/.../metadata_proxy.js
>
> Converted files:
> - ui/file_manager/file_manager/background/js/metadata_proxy.js
> - ui/file_manager/file_manager/background/js/metadata_proxy_unittest.js
>
> Bug: 1133186
> Change-Id: I81eb9d34fff12835ef5974acfee3817fec864340
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2563105
> Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
> Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#833130}

TBR=lucmult@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com,jboulic@chromium.org

Change-Id: I6a9840ebfbcd1643ae57ac0ecb0f30ee2dc54d3d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1133186
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2573698Reviewed-by: default avatarJeremie Boulic <jboulic@chromium.org>
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833588}
parent 7e8294a1
...@@ -201,7 +201,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, MetadataModel) { ...@@ -201,7 +201,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerJsTest, MetadataModel) {
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, MetadataProxyTest) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, MetadataProxyTest) {
RunTestURL("background/js/metadata_proxy_unittest.m_gen.html"); RunTestURL("background/js/metadata_proxy_unittest_gen.html");
} }
IN_PROC_BROWSER_TEST_F(FileManagerJsTest, MountMetricsTest) { IN_PROC_BROWSER_TEST_F(FileManagerJsTest, MountMetricsTest) {
......
...@@ -59,7 +59,6 @@ group("unit_test_data") { ...@@ -59,7 +59,6 @@ group("unit_test_data") {
deps = [ deps = [
"base/js:js_test_gen_html", "base/js:js_test_gen_html",
"file_manager/background/js:js_test_gen_html", "file_manager/background/js:js_test_gen_html",
"file_manager/background/js:js_test_gen_html_modules",
"file_manager/common/js:js_test_gen_html", "file_manager/common/js:js_test_gen_html",
"file_manager/common/js:js_test_gen_html_modules", "file_manager/common/js:js_test_gen_html_modules",
"file_manager/foreground/elements:js_test_gen_html", "file_manager/foreground/elements:js_test_gen_html",
......
This diff is collapsed.
#!/bin/bash
#
# Copyright (c) 2020 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.
# Command usage:
# ui/file_manager/base/tools/modules.sh out/Release ui/file_manager/
# file_manager/foreground/js/list_thumbnail_loader.js
# ui/file_manager/base/tools/modules.sh out/Release ui/file_manager/
# file_manager/common/js/importer_common.js
# ui/file_manager/base/tools/modules.sh out/Release ui/file_manager/
# file_manager/foreground/js/list_thumbnail_loader_unittest.js
# Input: js file to convert.
build_dir=$1;
file_path=$2;
dir=`dirname $file_path`;
compiler_output="$build_dir/gen/ui/file_manager/base/tools/compiler_output.txt";
# Create containing directory of `compiler_output` if doesn't exist.
mkdir -p `dirname $compiler_output`;
# Process files with Python.
ui/file_manager/base/tools/modules.py $file_path 'generate';
# Parse closure compiler output and update files until the message 'X error(s),
# Y warning(s), Z% typed' doesn't change.
prev_output=""
new_output="."
while [[ $prev_output != $new_output ]]; do
prev_output=$new_output;
# Run closure compiler and save output.
ninja -C $build_dir $dir:closure_compile 2>&1 | tee $compiler_output;
# Parse closure compiler output.
ui/file_manager/base/tools/modules.py $file_path 'parse' $compiler_output;
# Get number of errors from modules.txt.
new_output=$(cat $compiler_output | grep 'error(s)' );
done;
# Format files.
git cl format --js;
if [[ $new_output == "" ]]; then
echo "No closure compiler error found"
else
echo "Final state: " $new_output;
fi;
...@@ -26,7 +26,6 @@ group("closure_compile") { ...@@ -26,7 +26,6 @@ group("closure_compile") {
deps = [ deps = [
":closure_compile_jsmodules", ":closure_compile_jsmodules",
":closure_compile_module", ":closure_compile_module",
":js_test_gen_html_modules_type_check_auto",
":js_test_gen_html_type_check_auto", ":js_test_gen_html_type_check_auto",
":test_support_modules_type_check", ":test_support_modules_type_check",
":test_support_type_check", ":test_support_type_check",
...@@ -77,7 +76,6 @@ js_type_check("closure_compile_jsmodules") { ...@@ -77,7 +76,6 @@ js_type_check("closure_compile_jsmodules") {
":app_windows.m", ":app_windows.m",
":background_base.m", ":background_base.m",
":entry_location_impl.m", ":entry_location_impl.m",
":metadata_proxy.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",
...@@ -394,19 +392,11 @@ js_library("metadata_proxy") { ...@@ -394,19 +392,11 @@ js_library("metadata_proxy") {
deps = [ "//ui/file_manager/file_manager/common/js:lru_cache" ] deps = [ "//ui/file_manager/file_manager/common/js:lru_cache" ]
} }
js_library("metadata_proxy.m") { js_unittest("metadata_proxy_unittest") {
sources = [ "$root_gen_dir/ui/file_manager/file_manager/background/js/metadata_proxy.m.js" ]
deps = [ "//ui/file_manager/file_manager/common/js:lru_cache.m" ]
extra_deps = [ ":modulize" ]
}
js_unittest("metadata_proxy_unittest.m") {
deps = [ deps = [
":metadata_proxy.m", ":metadata_proxy",
"//chrome/test/data/webui:chai_assert", "//ui/file_manager/base/js:test_error_reporting",
"//ui/file_manager/base/js:test_error_reporting.m", "//ui/file_manager/file_manager/common/js:mock_entry",
"//ui/file_manager/file_manager/common/js:mock_entry.m",
] ]
} }
...@@ -783,19 +773,6 @@ js_library("volume_manager_util.m") { ...@@ -783,19 +773,6 @@ js_library("volume_manager_util.m") {
extra_deps = [ ":modulize" ] extra_deps = [ ":modulize" ]
} }
js_test_gen_html("js_test_gen_html_modules") {
deps = [ ":metadata_proxy_unittest.m" ]
js_module = true
closure_flags =
strict_error_checking_closure_args + [
"js_module_root=./gen/ui",
"js_module_root=../../ui",
"browser_resolver_prefix_replacements=\"chrome://test/=./\"",
"hide_warnings_for=third_party/",
]
}
js_test_gen_html("js_test_gen_html") { js_test_gen_html("js_test_gen_html") {
deps = [ deps = [
":crostini_unittest", ":crostini_unittest",
...@@ -807,6 +784,7 @@ js_test_gen_html("js_test_gen_html") { ...@@ -807,6 +784,7 @@ js_test_gen_html("js_test_gen_html") {
":import_history_unittest", ":import_history_unittest",
":media_import_handler_unittest", ":media_import_handler_unittest",
":media_scanner_unittest", ":media_scanner_unittest",
":metadata_proxy_unittest",
":mount_metrics_unittest", ":mount_metrics_unittest",
":task_queue_unittest", ":task_queue_unittest",
":trash_unittest", ":trash_unittest",
...@@ -816,7 +794,6 @@ js_test_gen_html("js_test_gen_html") { ...@@ -816,7 +794,6 @@ js_test_gen_html("js_test_gen_html") {
js_modulizer("modulize") { js_modulizer("modulize") {
input_files = [ input_files = [
"metadata_proxy.js",
"app_windows.js", "app_windows.js",
"app_window_wrapper.js", "app_window_wrapper.js",
"background_base.js", "background_base.js",
......
...@@ -2,13 +2,6 @@ ...@@ -2,13 +2,6 @@
// 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.
/**
* @fileoverview
* @suppress {uselessCode} Temporary suppress because of the line exporting.
*/
// #import {LRUCache} from '../../common/js/lru_cache.m.js';
// Namespace // Namespace
const metadataProxy = {}; const metadataProxy = {};
...@@ -83,6 +76,3 @@ metadataProxy.getEntryMetadata = entry => { ...@@ -83,6 +76,3 @@ metadataProxy.getEntryMetadata = entry => {
metadataProxy.overrideCacheTtlForTesting = ttl => { metadataProxy.overrideCacheTtlForTesting = ttl => {
metadataProxy.cache_ttl_seconds_ = ttl ? ttl : metadataProxy.MAX_TTL_SECONDS_; metadataProxy.cache_ttl_seconds_ = ttl ? ttl : metadataProxy.MAX_TTL_SECONDS_;
}; };
// eslint-disable-next-line semi,no-extra-semi
/* #export */ {metadataProxy};
...@@ -2,14 +2,7 @@ ...@@ -2,14 +2,7 @@
// 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 function testMetadataCaching(doneCallback) {
import {assertEquals} from 'chrome://test/chai_assert.js';
import {reportPromise} from '../../../base/js/test_error_reporting.m.js';
import {MockFileSystem} from '../../common/js/mock_entry.m.js';
import {metadataProxy} from './metadata_proxy.m.js';
// clang-format on
export function testMetadataCaching(doneCallback) {
reportPromise( reportPromise(
(async function() { (async function() {
const mockFileSystem = new MockFileSystem('volumeId'); const mockFileSystem = new MockFileSystem('volumeId');
...@@ -37,7 +30,7 @@ export function testMetadataCaching(doneCallback) { ...@@ -37,7 +30,7 @@ export function testMetadataCaching(doneCallback) {
doneCallback); doneCallback);
} }
export function testMetadataCacheExpiry(doneCallback) { function testMetadataCacheExpiry(doneCallback) {
reportPromise( reportPromise(
(async function() { (async function() {
const mockFileSystem = new MockFileSystem('volumeId'); const mockFileSystem = new MockFileSystem('volumeId');
......
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