Commit c58250c8 authored by Stephen McGruer's avatar Stephen McGruer Committed by Commit Bot

Roll new WPT js code.

This rolls up to sha d004bddde373550fe9a563487adda3e17fc4c697

Bug: None
Change-Id: I7b92df20ea3462512ff1978a766cf84a09d9e358
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480143
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Commit-Queue: Robert Ma <robertma@chromium.org>
Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820257}
parent 8d7cd411
This is a testharness.js-based test.
FAIL drag-selected-image-to-contenteditable resources/testharness.js:2001:25)
FAIL assertSelection(inputText, tester, expectedText, options) resources/testharness.js:2038:25)
expected <style>div, img { width: 200px; height: 100px; }</style><div contenteditable id="target">^<img id="image">|</div><img id="image">,
but got <style>div, img { width: 200px; height: 100px; }</style><div contenteditable id="target"></div>^<img id="image">|,
sameupto <style>div, img { width: 200px; height: 100px; }</style><div contenteditable id="target">
......
......@@ -23,6 +23,7 @@
this.createSource("none");
this.tickIdx = 0;
this.defaultTickDuration = defaultTickDuration;
this.context = null;
}
Actions.prototype = {
......@@ -66,7 +67,17 @@
} catch(e) {
return Promise.reject(e);
}
return test_driver.action_sequence(actions);
return test_driver.action_sequence(actions, this.context);
},
/**
* Set the context for the actions
*
* @param {WindowProxy} context - Context in which to run the action sequence
*/
setContext: function(context) {
this.context = context;
return this;
},
/**
......
......@@ -520,6 +520,43 @@ policies and contribution forms [3].
Object.prototype.toString.call(worker) == '[object ServiceWorker]';
}
var seen_func_name = Object.create(null);
function get_test_name(func, name)
{
if (name) {
return name;
}
if (func) {
var func_code = func.toString();
// Try and match with brackets, but fallback to matching without
var arrow = func_code.match(/^\(\)\s*=>\s*(?:{(.*)}\s*|(.*))$/);
// Check for JS line separators
if (arrow !== null && !/[\u000A\u000D\u2028\u2029]/.test(func_code)) {
var trimmed = (arrow[1] !== undefined ? arrow[1] : arrow[2]).trim();
// drop trailing ; if there's no earlier ones
trimmed = trimmed.replace(/^([^;]*)(;\s*)+$/, "$1");
if (trimmed) {
let name = trimmed;
if (seen_func_name[trimmed]) {
// This subtest name already exists, so add a suffix.
name += " " + seen_func_name[trimmed];
} else {
seen_func_name[trimmed] = 0;
}
seen_func_name[trimmed] += 1;
return name;
}
}
}
return test_environment.next_default_test_name();
}
/*
* API functions
*/
......@@ -530,7 +567,7 @@ policies and contribution forms [3].
tests.status.message = '`test` invoked after `promise_setup`';
tests.complete();
}
var test_name = name ? name : test_environment.next_default_test_name();
var test_name = get_test_name(func, name);
var test_obj = new Test(test_name, properties);
var value = test_obj.step(func, test_obj, test_obj);
......@@ -566,7 +603,7 @@ policies and contribution forms [3].
name = func;
func = null;
}
var test_name = name ? name : test_environment.next_default_test_name();
var test_name = get_test_name(func, name);
var test_obj = new Test(test_name, properties);
if (func) {
var value = test_obj.step(func, test_obj, test_obj);
......@@ -603,7 +640,7 @@ policies and contribution forms [3].
name = func;
func = null;
}
var test_name = name ? name : test_environment.next_default_test_name();
var test_name = get_test_name(func, name);
var test = new Test(test_name, properties);
test._is_promise_test = true;
......@@ -3797,7 +3834,7 @@ policies and contribution forms [3].
function get_title()
{
if ('document' in global_scope) {
//Don't use document.title to work around an Opera bug in XHTML documents
//Don't use document.title to work around an Opera/Presto bug in XHTML documents
var title = document.getElementsByTagName("title")[0];
if (title && title.firstChild && title.firstChild.data) {
return title.firstChild.data;
......
CONSOLE ERROR: line 3566: Uncaught Error: assert_equals: Normal script execution order comparison expected "Inline1;Sync1;EndOfBody;DOMContentLoaded;Async1;" but got "EndOfBody;Inline1;Sync1;DOMContentLoaded;Async1;"
CONSOLE ERROR: line 3603: Uncaught Error: assert_equals: Normal script execution order comparison expected "Inline1;Sync1;EndOfBody;DOMContentLoaded;Async1;" but got "EndOfBody;Inline1;Sync1;DOMContentLoaded;Async1;"
This is a testharness.js-based test.
FAIL Async Script Execution Order (wrt possibly deferred Synchronous Script) Uncaught Error: assert_equals: Normal script execution order comparison expected "Inline1;Sync1;EndOfBody;DOMContentLoaded;Async1;" but got "EndOfBody;Inline1;Sync1;DOMContentLoaded;Async1;"
Harness: the test ran to completion.
......
CONSOLE ERROR: line 3566: Uncaught Error: assert_equals: Normal defer script execution order comparison expected "Inline1;Sync1;Inline2;Sync2;EndOfBody;Defer1;Defer2;DOMContentLoaded;" but got "EndOfBody;Inline1;Sync1;Inline2;Sync2;Defer1;Defer2;DOMContentLoaded;"
CONSOLE ERROR: line 3603: Uncaught Error: assert_equals: Normal defer script execution order comparison expected "Inline1;Sync1;Inline2;Sync2;EndOfBody;Defer1;Defer2;DOMContentLoaded;" but got "EndOfBody;Inline1;Sync1;Inline2;Sync2;Defer1;Defer2;DOMContentLoaded;"
This is a testharness.js-based test.
FAIL Defer Script Execution Order Uncaught Error: assert_equals: Normal defer script execution order comparison expected "Inline1;Sync1;Inline2;Sync2;EndOfBody;Defer1;Defer2;DOMContentLoaded;" but got "EndOfBody;Inline1;Sync1;Inline2;Sync2;Defer1;Defer2;DOMContentLoaded;"
Harness: the test ran to completion.
......
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