Commit 395cf32d authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Preparation of moving LayoutTests to web_tests.

* layout_test_content_browser_client.cc:
  Pass --tests-in-blink flag to a renderer process.
  GetWebTestsFilePath() in blink_test_helpers.cc needs this flag.

* LayoutTests/editing/assert_selection.html
* LayoutTests/editing/assert_selection.js
* LayoutTests/editing/execCommand/insert-paragraph-into-table-expected.txt
  Drop 'LayoutTests/' part from error description

* LayoutTests/external/wpt/bluetooth/resources/bluetooth-helpers.js
* LayoutTests/external/wpt/webusb/resources/usb-helpers.js
  Support web_tests/ as well as LayoutTests/

* LayoutTests/fast/js/exception-line-number-expected.txt
* LayoutTests/fast/js/script-tests/exception-line-number.js
  Drop 'LayoutTests/' part from error description

Bug: 843412
Change-Id: I817b40bb2e7edf0216a32d9f3a3e2320e4b6956a
Reviewed-on: https://chromium-review.googlesource.com/c/1329811Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607165}
parent d9ae7ad7
...@@ -174,6 +174,10 @@ void LayoutTestContentBrowserClient::AppendExtraCommandLineSwitches( ...@@ -174,6 +174,10 @@ void LayoutTestContentBrowserClient::AppendExtraCommandLineSwitches(
command_line->AppendSwitch(switches::kRunWebTests); command_line->AppendSwitch(switches::kRunWebTests);
ShellContentBrowserClient::AppendExtraCommandLineSwitches(command_line, ShellContentBrowserClient::AppendExtraCommandLineSwitches(command_line,
child_process_id); child_process_id);
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kTestsInBlink)) {
command_line->AppendSwitch(switches::kTestsInBlink);
}
if (base::CommandLine::ForCurrentProcess()->HasSwitch( if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAlwaysUseComplexText)) { switches::kAlwaysUseComplexText)) {
command_line->AppendSwitch(switches::kAlwaysUseComplexText); command_line->AppendSwitch(switches::kAlwaysUseComplexText);
......
...@@ -317,7 +317,7 @@ test(() => { ...@@ -317,7 +317,7 @@ test(() => {
// |CreateUnifiedDiff()| in gtest or "Longest common substring" // |CreateUnifiedDiff()| in gtest or "Longest common substring"
test(() => { test(() => {
assert_equals(checked_assert_selection('foo', 'noop', 'foz'), assert_equals(checked_assert_selection('foo', 'noop', 'foz'),
`LayoutTests/editing/assert_selection.html:8:9)\n` + `editing/assert_selection.html:8:9)\n` +
`\t expected foz,\n` + `\t expected foz,\n` +
`\t but got foo,\n` + `\t but got foo,\n` +
`\t sameupto fo`); `\t sameupto fo`);
......
...@@ -896,7 +896,7 @@ function assembleDescription() { ...@@ -896,7 +896,7 @@ function assembleDescription() {
for (const line of getStack()) { for (const line of getStack()) {
const match = RE_IN_ASSERT_SELECTION.exec(line); const match = RE_IN_ASSERT_SELECTION.exec(line);
if (!match) { if (!match) {
const RE_LAYOUTTESTS = new RegExp('(?:LayoutTests|web_tests).*'); const RE_LAYOUTTESTS = new RegExp('(?<=LayoutTests/|web_tests/).*');
return RE_LAYOUTTESTS.exec(line); return RE_LAYOUTTESTS.exec(line);
} }
} }
......
This is a testharness.js-based test. This is a testharness.js-based test.
FAIL This InsertParagraph non-table layout item into table layout. LayoutTests/editing/execCommand/insert-paragraph-into-table.html:7:11) FAIL This InsertParagraph non-table layout item into table layout. editing/execCommand/insert-paragraph-into-table.html:7:11)
expected <div contenteditable><table><tbody><tr><td style="display:inline-block"><ruby><rt>a</rt></ruby></td></tr><tr><font size="1">|<br></font></tr></tbody></table></div>, expected <div contenteditable><table><tbody><tr><td style="display:inline-block"><ruby><rt>a</rt></ruby></td></tr><tr><font size="1">|<br></font></tr></tbody></table></div>,
but got <div contenteditable><table><tbody><tr><td style="display:inline-block"><ruby><rt>a</rt></ruby></td></tr><tr><span style="font-size: 8px;">|<br></span></tr></tbody></table></div>, but got <div contenteditable><table><tbody><tr><td style="display:inline-block"><ruby><rt>a</rt></ruby></td></tr><tr><span style="font-size: 8px;">|<br></span></tr></tbody></table></div>,
sameupto <div contenteditable><table><tbody><tr><td style="display:inline-block"><ruby><rt>a</rt></ruby></td></tr><tr>< sameupto <div contenteditable><table><tbody><tr><td style="display:inline-block"><ruby><rt>a</rt></ruby></td></tr><tr><
......
...@@ -26,8 +26,9 @@ function performChromiumSetup() { ...@@ -26,8 +26,9 @@ function performChromiumSetup() {
// Load the Chromium-specific resources. // Load the Chromium-specific resources.
let prefix = '/resources/chromium'; let prefix = '/resources/chromium';
let extra = []; let extra = [];
if (window.location.pathname.includes('/LayoutTests/')) { const pathname = window.location.pathname;
let root = window.location.pathname.match(/.*LayoutTests/); if (pathname.includes('/LayoutTests/') || pathname.includes('/web_tests/')) {
let root = pathname.match(/.*(?:LayoutTests|web_tests)/);
prefix = `${root}/external/wpt/resources/chromium`; prefix = `${root}/external/wpt/resources/chromium`;
extra = [ extra = [
`${root}/resources/bluetooth/bluetooth-fake-adapter.js`, `${root}/resources/bluetooth/bluetooth-fake-adapter.js`,
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
if ('MojoInterfaceInterceptor' in self) { if ('MojoInterfaceInterceptor' in self) {
let prefix = '/resources/chromium'; let prefix = '/resources/chromium';
if ('window' in self) { if ('window' in self) {
if (window.location.pathname.includes('/LayoutTests/')) { const pathname = window.location.pathname;
let root = window.location.pathname.match(/.*LayoutTests/); if (pathname.includes('/LayoutTests/') || pathname.includes('/web_tests/')) {
let root = pathname.match(/.*(?:LayoutTests|web_tests)/);
prefix = `${root}/external/wpt/resources/chromium`; prefix = `${root}/external/wpt/resources/chromium`;
} }
} }
......
...@@ -2,8 +2,8 @@ This test makes sure the exception stack has line number information. ...@@ -2,8 +2,8 @@ This test makes sure the exception stack has line number information.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS result is "LayoutTests/fast/js/script-tests/exception-line-number.js:6,LayoutTests/fast/js/script-tests/exception-line-number.js:11" PASS result is "fast/js/script-tests/exception-line-number.js:6,fast/js/script-tests/exception-line-number.js:11"
PASS result is "LayoutTests/fast/js/script-tests/exception-line-number.js:36" PASS result is "fast/js/script-tests/exception-line-number.js:36"
PASS successfullyParsed is true PASS successfullyParsed is true
TEST COMPLETE TEST COMPLETE
......
...@@ -18,17 +18,17 @@ foo(); // line 11 ...@@ -18,17 +18,17 @@ foo(); // line 11
// elements back into a comma separated string by simply stringifying the // elements back into a comma separated string by simply stringifying the
// array. This makes it easier to compare the resultant stack trace info. // array. This makes it easier to compare the resultant stack trace info.
result = String(temp.match(/(?:LayoutTests|web_tests)\/[^:]+\:[0-9]+/g)); result = String(temp.match(/(?<=LayoutTests\/|web_tests\/)[^:]+\:[0-9]+/g));
shouldBe("result", '"LayoutTests/fast/js/script-tests/exception-line-number.js:6,LayoutTests/fast/js/script-tests/exception-line-number.js:11"'); shouldBe("result", '"fast/js/script-tests/exception-line-number.js:6,fast/js/script-tests/exception-line-number.js:11"');
// Test window.onerror: // Test window.onerror:
window.onerror = function(msg, url, line) { window.onerror = function(msg, url, line) {
url = String(url.match(/(?:LayoutTests|web_tests)\/[^:]+/g)); url = String(url.match(/(?<=LayoutTests\/|web_tests\/)[^:]+/g));
result = url + ':' + line; result = url + ':' + line;
shouldBe("result", '"LayoutTests/fast/js/script-tests/exception-line-number.js:36"'); shouldBe("result", '"fast/js/script-tests/exception-line-number.js:36"');
return true; // We handled it. return true; // We handled it.
} }
......
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