Commit fb7687ca authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@cb9176baeb50e0ee5a010218388e8120c09bab0f

Using wpt-import in Chromium d5603eb9.

Build: https://ci.chromium.org/buildbot/chromium.infra.cron/wpt-importer/17282

Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
jsbell@chromium.org:
  external/wpt/resources

TBR=markdittmer

No-Export: true
Change-Id: I67eb3e30091a1ae3e7c82eb7ca8c32235ad74c98
Reviewed-on: https://chromium-review.googlesource.com/1055308
Commit-Queue: Blink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Reviewed-by: default avatarBlink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557818}
parent c6f50160
......@@ -2789,6 +2789,7 @@ crbug.com/832071 external/wpt/service-workers/service-worker/worker-client-id.ht
crbug.com/832071 virtual/navigation-mojo-response/external/wpt/service-workers/service-worker/worker-client-id.https.html [ Failure ]
# ====== New tests from wpt-importer added here ======
crbug.com/626703 [ Retina ] external/wpt/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html [ Skip ]
crbug.com/626703 [ Win7 ] external/wpt/pointerevents/pointerevent_pointerout_received_once-manual.html [ Skip ]
crbug.com/626703 external/wpt/css/css-shapes/shape-outside/shape-image/gradients/shape-outside-linear-gradient-016.html [ Failure ]
crbug.com/626703 external/wpt/css/css-shapes/shape-outside/shape-image/gradients/shape-outside-linear-gradient-013.html [ Failure ]
......
......@@ -451,6 +451,50 @@ policies and contribution forms [3].
}
};
/*
* JavaScript shells.
*
* This class is used as the test_environment when testharness is running
* inside a JavaScript shell.
*/
function ShellTestEnvironment() {
this.name_counter = 0;
this.all_loaded = false;
this.on_loaded_callback = null;
Promise.resolve().then(function() {
this.all_loaded = true
if (this.on_loaded_callback) {
this.on_loaded_callback();
}
}.bind(this));
this.message_list = [];
this.message_ports = [];
}
ShellTestEnvironment.prototype.next_default_test_name = function() {
var suffix = this.name_counter > 0 ? " " + this.name_counter : "";
this.name_counter++;
return "Untitled" + suffix;
};
ShellTestEnvironment.prototype.on_new_harness_properties = function() {};
ShellTestEnvironment.prototype.on_tests_ready = function() {};
ShellTestEnvironment.prototype.add_on_loaded_callback = function(callback) {
if (this.all_loaded) {
callback();
} else {
this.on_loaded_callback = callback;
}
};
ShellTestEnvironment.prototype.test_timeout = function() {
// Tests running in a shell don't have a default timeout, so behave as
// if settings.explicit_timeout is true.
return null;
};
function create_test_environment() {
if ('document' in global_scope) {
return new WindowTestEnvironment();
......@@ -472,6 +516,10 @@ policies and contribution forms [3].
return new DedicatedWorkerTestEnvironment();
}
if (!('self' in global_scope)) {
return new ShellTestEnvironment();
}
throw new Error("Unsupported test environment");
}
......@@ -1610,7 +1658,9 @@ policies and contribution forms [3].
this.phase = this.phases.COMPLETE;
clearTimeout(this.timeout_id);
if (global_scope.clearTimeout) {
clearTimeout(this.timeout_id);
}
tests.result(this);
this.cleanup();
};
......@@ -1925,12 +1975,14 @@ policies and contribution forms [3].
};
Tests.prototype.set_timeout = function() {
var this_obj = this;
clearTimeout(this.timeout_id);
if (this.timeout_length !== null) {
this.timeout_id = setTimeout(function() {
this_obj.timeout();
}, this.timeout_length);
if (global_scope.clearTimeout) {
var this_obj = this;
clearTimeout(this.timeout_id);
if (this.timeout_length !== null) {
this.timeout_id = setTimeout(function() {
this_obj.timeout();
}, this.timeout_length);
}
}
};
......@@ -2910,36 +2962,38 @@ policies and contribution forms [3].
var tests = new Tests();
var error_handler = function(e) {
if (tests.tests.length === 0 && !tests.allow_uncaught_exception) {
tests.set_file_is_test();
}
if (global_scope.addEventListener) {
var error_handler = function(e) {
if (tests.tests.length === 0 && !tests.allow_uncaught_exception) {
tests.set_file_is_test();
}
var stack;
if (e.error && e.error.stack) {
stack = e.error.stack;
} else {
stack = e.filename + ":" + e.lineno + ":" + e.colno;
}
var stack;
if (e.error && e.error.stack) {
stack = e.error.stack;
} else {
stack = e.filename + ":" + e.lineno + ":" + e.colno;
}
if (tests.file_is_test) {
var test = tests.tests[0];
if (test.phase >= test.phases.HAS_RESULT) {
return;
if (tests.file_is_test) {
var test = tests.tests[0];
if (test.phase >= test.phases.HAS_RESULT) {
return;
}
test.set_status(test.FAIL, e.message, stack);
test.phase = test.phases.HAS_RESULT;
test.done();
} else if (!tests.allow_uncaught_exception) {
tests.status.status = tests.status.ERROR;
tests.status.message = e.message;
tests.status.stack = stack;
}
test.set_status(test.FAIL, e.message, stack);
test.phase = test.phases.HAS_RESULT;
test.done();
} else if (!tests.allow_uncaught_exception) {
tests.status.status = tests.status.ERROR;
tests.status.message = e.message;
tests.status.stack = stack;
}
done();
};
done();
};
addEventListener("error", error_handler, false);
addEventListener("unhandledrejection", function(e){ error_handler(e.reason); }, false);
addEventListener("error", error_handler, false);
addEventListener("unhandledrejection", function(e){ error_handler(e.reason); }, false);
}
test_environment.on_tests_ready();
......
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