Commit 62be31e8 authored by A Olsen's avatar A Olsen Committed by Commit Bot

Use source absolute paths in JS tests

Source absolute paths //a/b/c are now supported, so no need
to use ../../../../../a/b/c

This migrates several tests where it is an easy change.

Change-Id: Ia7a8ba50a20a9b218e4b271c25449e3064148e55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1578616Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: A Olsen <olsen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653644}
parent db66b204
......@@ -6,9 +6,6 @@
* @fileoverview Tests for chrome://bluetooth-internals
*/
/** @const {string} Path to source root. */
var ROOT_PATH = '../../../../';
/**
* Test fixture for BluetoothInternals WebUI testing.
* @constructor
......@@ -33,12 +30,12 @@ BluetoothInternalsTest.prototype = {
/** @override */
extraLibraries: [
ROOT_PATH + 'third_party/mocha/mocha.js',
ROOT_PATH + 'chrome/test/data/webui/mocha_adapter.js',
ROOT_PATH + 'ui/webui/resources/js/promise_resolver.js',
ROOT_PATH + 'ui/webui/resources/js/cr.js',
ROOT_PATH + 'ui/webui/resources/js/util.js',
ROOT_PATH + 'chrome/test/data/webui/test_browser_proxy.js',
'//third_party/mocha/mocha.js',
'//chrome/test/data/webui/mocha_adapter.js',
'//ui/webui/resources/js/promise_resolver.js',
'//ui/webui/resources/js/cr.js',
'//ui/webui/resources/js/util.js',
'//chrome/test/data/webui/test_browser_proxy.js',
],
preLoad: function() {
......
......@@ -4,7 +4,7 @@
/**
* @fileoverview Fake implementation of chrome.networkingPrivate for testing.
* NOTE: Include "ROOT_PATH + 'ui/webui/resources/js/promise_resolver.js'"
* NOTE: Include "'//ui/webui/resources/js/promise_resolver.js'"
* in any test that uses this.
*/
cr.define('chrome', function() {
......
......@@ -5,7 +5,6 @@
/**
* @fileoverview Test suite for the Site Engagement WebUI.
*/
var ROOT_PATH = '../../../../../';
var EXAMPLE_URL_1 = 'http://example.com/';
var EXAMPLE_URL_2 = 'http://shmlexample.com/';
......@@ -33,8 +32,8 @@ SiteEngagementBrowserTest.prototype = {
},
extraLibraries: [
ROOT_PATH + 'third_party/mocha/mocha.js',
ROOT_PATH + 'chrome/test/data/webui/mocha_adapter.js',
'//third_party/mocha/mocha.js',
'//chrome/test/data/webui/mocha_adapter.js',
],
/** @override */
......
......@@ -6,9 +6,6 @@
* @fileoverview Tests for interventions_internals.js
*/
/** @const {string} Path to source root. */
let ROOT_PATH = '../../../../';
/**
* Test fixture for InterventionsInternals WebUI testing.
* @constructor
......@@ -31,11 +28,11 @@ InterventionsInternalsUITest.prototype = {
isAsync: true,
extraLibraries: [
ROOT_PATH + 'third_party/mocha/mocha.js',
ROOT_PATH + 'chrome/test/data/webui/mocha_adapter.js',
ROOT_PATH + 'ui/webui/resources/js/promise_resolver.js',
ROOT_PATH + 'ui/webui/resources/js/util.js',
ROOT_PATH + 'chrome/test/data/webui/test_browser_proxy.js',
'//third_party/mocha/mocha.js',
'//chrome/test/data/webui/mocha_adapter.js',
'//ui/webui/resources/js/promise_resolver.js',
'//ui/webui/resources/js/util.js',
'//chrome/test/data/webui/test_browser_proxy.js',
],
preLoad: function() {
......
......@@ -5,7 +5,6 @@
/**
* @fileoverview Test suite for the Media Engagement WebUI.
*/
var ROOT_PATH = '../../../../../';
var EXAMPLE_URL_1 = 'http://example.com/';
var EXAMPLE_URL_2 = 'http://shmlexample.com/';
......@@ -44,8 +43,8 @@ MediaEngagementWebUIBrowserTest.prototype = {
},
extraLibraries: [
ROOT_PATH + 'third_party/mocha/mocha.js',
ROOT_PATH + 'chrome/test/data/webui/mocha_adapter.js',
'//third_party/mocha/mocha.js',
'//chrome/test/data/webui/mocha_adapter.js',
],
};
......
......@@ -4,8 +4,6 @@
/** @fileoverview Tests for settings-idle-load. */
/** @const {string} Path to root from chrome/test/data/webui/settings/. */
const ROOT_PATH = '../../../../../';
/**
* @constructor
......@@ -21,7 +19,7 @@ SettingsIdleLoadBrowserTest.prototype = {
/** @override */
extraLibraries: [
ROOT_PATH + 'third_party/mocha/mocha.js',
'//third_party/mocha/mocha.js',
'../mocha_adapter.js',
],
......
......@@ -5,7 +5,6 @@
/**
* @fileoverview Test suite for the SysInternals WebUI. (CrOS only)
*/
const ROOT_PATH = '../../../../../';
GEN('#include "chrome/common/chrome_features.h"');
/* Set up this global variable to disable sending the update request. */
......@@ -35,10 +34,10 @@ SysInternalsBrowserTest.prototype = {
'page_switch_test.js',
'page_unit_test.js',
'test_util.js',
ROOT_PATH + 'third_party/mocha/mocha.js',
ROOT_PATH + 'third_party/polymer/v1_0/components-chromium/' +
'//third_party/mocha/mocha.js',
'//third_party/polymer/v1_0/components-chromium/' +
'iron-test-helpers/mock-interactions.js',
ROOT_PATH + 'chrome/test/data/webui/mocha_adapter.js',
'//chrome/test/data/webui/mocha_adapter.js',
],
};
......
......@@ -6,9 +6,6 @@
* @fileoverview Tests for chrome://usb-internals
*/
/** @const {string} Path to source root. */
const ROOT_PATH = '../../../../';
/**
* Test fixture for testing async methods of cr.js.
* @constructor
......@@ -32,12 +29,12 @@ UsbInternalsTest.prototype = {
/** @override */
extraLibraries: [
ROOT_PATH + 'third_party/mocha/mocha.js',
ROOT_PATH + 'chrome/test/data/webui/mocha_adapter.js',
ROOT_PATH + 'ui/webui/resources/js/promise_resolver.js',
ROOT_PATH + 'ui/webui/resources/js/cr.js',
ROOT_PATH + 'ui/webui/resources/js/util.js',
ROOT_PATH + 'chrome/test/data/webui/test_browser_proxy.js',
'//third_party/mocha/mocha.js',
'//chrome/test/data/webui/mocha_adapter.js',
'//ui/webui/resources/js/promise_resolver.js',
'//ui/webui/resources/js/cr.js',
'//ui/webui/resources/js/util.js',
'//chrome/test/data/webui/test_browser_proxy.js',
],
preLoad: function() {
......@@ -198,4 +195,4 @@ TEST_F('UsbInternalsTest', 'WebUITest', function() {
// Run all registered tests.
mocha.run();
});
\ No newline at end of file
});
......@@ -6,9 +6,6 @@
* @fileoverview Framework for running async JS tests for cr.js utility methods.
*/
/** @const {string} Path to source root. */
var ROOT_PATH = '../../../../';
/** @const {string} Name of the chrome.send() message to be used in tests. */
var CHROME_SEND_NAME = 'echoMessage';
......@@ -33,10 +30,10 @@ WebUIResourceAsyncTest.prototype = {
/** @override */
extraLibraries: [
ROOT_PATH + 'third_party/mocha/mocha.js',
ROOT_PATH + 'chrome/test/data/webui/mocha_adapter.js',
ROOT_PATH + 'ui/webui/resources/js/promise_resolver.js',
ROOT_PATH + 'ui/webui/resources/js/cr.js',
'//third_party/mocha/mocha.js',
'//chrome/test/data/webui/mocha_adapter.js',
'//ui/webui/resources/js/promise_resolver.js',
'//ui/webui/resources/js/cr.js',
],
};
......
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