0

WebUI: Remove flattenhtml=true from webui_resources.grd JS files.

Specifically:
 - Update remaining usages of js/util.js to explicitly pull-in
   js/assert.js.
 - Update webui_resources.grd to not use flattenhtml=true for
   JS files.
 - Remove "// <include src=..." directives from affected files

This is in preparation of moving such files over to the
auto-generated webui_generated_resources.grd, which (purposefully)
no longer supports flattenhtml.

Bug: 1132403
Change-Id: Idb9e4df54348c3eac3cbe7152893e3d5c5bd82a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2503833
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Auto-Submit: dpapad <dpapad@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823308}
This commit is contained in:
dpapad
2020-11-02 21:52:09 +00:00
committed by Commit Bot
parent 3848643957
commit e2575bf8c6
17 changed files with 16 additions and 16 deletions

@ -9,6 +9,7 @@
<link rel="stylesheet" href="../../../../../components/security_interstitials/core/common/resources/interstitial_core.css">
<link rel="stylesheet" href="supervised_user_block_interstitial.css">
<script src="../../../../../ui/webui/resources/js/cr.js"></script>
<script src="../../../../../ui/webui/resources/js/assert.js"></script>
<script src="../../../../../ui/webui/resources/js/util.js"></script>
<script src="supervised_user_block_interstitial.js"></script>
</head>

@ -31,6 +31,7 @@ BluetoothInternalsTest.prototype = {
extraLibraries: [
'//third_party/mocha/mocha.js',
'//chrome/test/data/webui/mocha_adapter.js',
'//ui/webui/resources/js/assert.js',
'//ui/webui/resources/js/promise_resolver.js',
'//ui/webui/resources/js/cr.js',
'//ui/webui/resources/js/util.js',

@ -32,6 +32,7 @@ InterventionsInternalsUITest.prototype = {
extraLibraries: [
'//third_party/mocha/mocha.js',
'//chrome/test/data/webui/mocha_adapter.js',
'//ui/webui/resources/js/assert.js',
'//ui/webui/resources/js/promise_resolver.js',
'//ui/webui/resources/js/util.js',
'//chrome/test/data/webui/test_browser_proxy.js',

@ -3,6 +3,7 @@
<body>
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script>
<script src="chrome://resources/js/assert.js"></script>
<script src="chrome://resources/js/cr/ui/array_data_model.js"></script>
<script src="array_data_model_test.js"></script>
</body>

@ -4,6 +4,7 @@
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script>
<script src="chrome://resources/js/cr/ui.js"></script>
<script src="chrome://resources/js/assert.js"></script>
<script src="chrome://resources/js/cr/ui/array_data_model.js"></script>
<script src="chrome://resources/js/cr/ui/list.js"></script>
<script src="chrome://resources/js/cr/ui/list_item.js"></script>

@ -4,6 +4,7 @@
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script>
<script src="chrome://resources/js/cr/ui.js"></script>
<script src="chrome://resources/js/assert.js"></script>
<script src="chrome://resources/js/cr/ui/array_data_model.js"></script>
<script src="chrome://resources/js/cr/ui/list_item.js"></script>
<script src="chrome://resources/js/cr/ui/list_selection_controller.js"></script>

@ -4,6 +4,7 @@
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/ui.js"></script>
<script src="chrome://resources/js/cr/ui/splitter.js"></script>
<script src="chrome://resources/js/assert.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="splitter_test.js"></script>
</body>

@ -2,6 +2,7 @@
<html>
<body>
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/assert.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="chrome://resources/js/icon.js"></script>
<script src="icon_test.js"></script>

@ -36,6 +36,7 @@ PolymerTest.prototype = {
*/
extraLibraries: [
'//ui/webui/resources/js/cr.js',
'//ui/webui/resources/js/assert.js',
'//ui/webui/resources/js/promise_resolver.js',
'//third_party/mocha/mocha.js',
'//chrome/test/data/webui/mocha_adapter.js',

@ -4,6 +4,7 @@
<a id="file" href="file:///path/to/file">File</a>
<a id="chrome" href="about:chrome">Chrome</a>
<a href="about:blank"><b id="blank">Click me</b></a>
<script src="chrome://resources/js/assert.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="util_test.js"></script>
</body>

@ -27,6 +27,7 @@ WelcomeA11y = class extends PolymerTest {
return [
'//third_party/mocha/mocha.js',
'//chrome/test/data/webui/mocha_adapter.js',
'//ui/webui/resources/js/assert.js',
'//ui/webui/resources/js/util.js',
];
}

@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>WebRTC Internals</title>
<link rel="stylesheet" href="webrtc_internals.css">
<script src="chrome://resources/js/assert.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="webrtc_internals.js"></script>
</head>

@ -31,6 +31,7 @@ WebUI resources in `components/` will be added in your specific project folder.
<link rel="stylesheet" href="hello_world.css">
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://resources/js/assert.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="strings.js"></script>
<script src="hello_world.js"></script>

@ -6,13 +6,6 @@
* @fileoverview This is a data model representin
*/
// The include directives are put into Javascript-style comments to prevent
// parsing errors in non-flattened mode. The flattener still sees them.
// Note that this makes the flattener to comment out the first line of the
// included file but that's all right since any javascript file should start
// with a copyright comment anyway.
// <include src="../../assert.js">
// #import {assert} from '../../assert.m.js';
// #import {NativeEventTarget as EventTarget} from '../event_target.m.js'

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// <include src="../../assert.js">
// #import {assert} from '../../assert.m.js';
// #import {isWindows} from '../../cr.m.js';
// #import {EventTracker} from '../../event_tracker.m.js'

@ -4,7 +4,6 @@
// #import {assertInstanceof} from './assert.m.js';
// #import {dispatchSimpleEvent} from './cr.m.js';
// <include src="assert.js">
/**
* Alias for document.getElementById. Found elements must be HTMLElements.

@ -360,8 +360,7 @@ without changes to the corresponding grd file. -->
<structure name="IDR_WEBUI_JS_CR_UI_JS"
file="js/cr/ui.js" type="chrome_html" />
<structure name="IDR_WEBUI_JS_CR_UI_ARRAY_DATA_MODEL_JS"
file="js/cr/ui/array_data_model.js"
type="chrome_html" flattenhtml="true" />
file="js/cr/ui/array_data_model.js" type="chrome_html" />
<structure name="IDR_WEBUI_JS_CR_UI_BUBBLE_JS"
file="js/cr/ui/bubble.js" type="chrome_html" />
<structure name="IDR_WEBUI_JS_CR_UI_BUBBLE_BUTTON_JS"
@ -434,8 +433,7 @@ without changes to the corresponding grd file. -->
<structure name="IDR_WEBUI_JS_EVENT_TRACKER_JS"
file="js/event_tracker.js" type="chrome_html" />
<structure name="IDR_WEBUI_JS_ICON_JS"
file="js/icon.js" type="chrome_html"
flattenhtml="true" />
file="js/icon.js" type="chrome_html" />
<structure name="IDR_WEBUI_JS_I18N_TEMPLATE_NO_PROCESS_JS"
file="js/i18n_template_no_process.js"
type="chrome_html" />
@ -446,8 +444,7 @@ without changes to the corresponding grd file. -->
<structure name="IDR_WEBUI_JS_TEST_LOADER_JS"
file="js/test_loader.js" type="chrome_html"/>
<structure name="IDR_WEBUI_JS_UTIL_JS"
file="js/util.js" type="chrome_html"
flattenhtml="true" />
file="js/util.js" type="chrome_html" preprocess="true"/>
<structure name="IDR_WEBUI_JS_WEBUI_RESOURCE_TEST_JS"
file="js/webui_resource_test.js" type="chrome_html" />