<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[212147] trunk/LayoutTests</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/212147">212147</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-02-10 13:51:44 -0800 (Fri, 10 Feb 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Update LayoutTests/resources/testharness.js
https://bugs.webkit.org/show_bug.cgi?id=168100
Reviewed by Youenn Fablet.
Update LayoutTests/resources/testharness.js to match the web-platform-tests
one landed in <a href="http://trac.webkit.org/projects/webkit/changeset/211930">r211930</a>.
* media/track/w3c/interfaces/HTMLTrackElement/srclang-expected.txt:
* media/track/w3c/interfaces/TextTrack/language-expected.txt:
* resources/testharness.js:
(SharedWorkerTestEnvironment):
(ServiceWorkerTestEnvironment):
(create_test_environment):
(promise_test):
(EventWatcher):
(is_node):
(format_value):
* streams/shadowing-Promise-expected.txt:
* streams/shadowing-Promise.html:
* streams/streams-public-array-api-expected.txt: Added.
* streams/streams-public-array-api.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediatrackw3cinterfacesHTMLTrackElementsrclangexpectedtxt">trunk/LayoutTests/media/track/w3c/interfaces/HTMLTrackElement/srclang-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackw3cinterfacesTextTracklanguageexpectedtxt">trunk/LayoutTests/media/track/w3c/interfaces/TextTrack/language-expected.txt</a></li>
<li><a href="#trunkLayoutTestsresourcestestharnessjs">trunk/LayoutTests/resources/testharness.js</a></li>
<li><a href="#trunkLayoutTestsstreamsshadowingPromiseexpectedtxt">trunk/LayoutTests/streams/shadowing-Promise-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstreamsshadowingPromisehtml">trunk/LayoutTests/streams/shadowing-Promise.html</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstreamsstreamspublicarrayapiexpectedtxt">trunk/LayoutTests/streams/streams-public-array-api-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstreamsstreamspublicarrayapihtml">trunk/LayoutTests/streams/streams-public-array-api.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (212146 => 212147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-02-10 21:34:27 UTC (rev 212146)
+++ trunk/LayoutTests/ChangeLog        2017-02-10 21:51:44 UTC (rev 212147)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2017-02-10 Chris Dumez <cdumez@apple.com>
+
+ Update LayoutTests/resources/testharness.js
+ https://bugs.webkit.org/show_bug.cgi?id=168100
+
+ Reviewed by Youenn Fablet.
+
+ Update LayoutTests/resources/testharness.js to match the web-platform-tests
+ one landed in r211930.
+
+ * media/track/w3c/interfaces/HTMLTrackElement/srclang-expected.txt:
+ * media/track/w3c/interfaces/TextTrack/language-expected.txt:
+ * resources/testharness.js:
+ (SharedWorkerTestEnvironment):
+ (ServiceWorkerTestEnvironment):
+ (create_test_environment):
+ (promise_test):
+ (EventWatcher):
+ (is_node):
+ (format_value):
+ * streams/shadowing-Promise-expected.txt:
+ * streams/shadowing-Promise.html:
+ * streams/streams-public-array-api-expected.txt: Added.
+ * streams/streams-public-array-api.html: Added.
+
</ins><span class="cx"> 2017-02-10 Ryan Haddad <ryanhaddad@apple.com>
</span><span class="cx">
</span><span class="cx"> Skip some very slow WebCryptoAPI tests.
</span></span></pre></div>
<a id="trunkLayoutTestsmediatrackw3cinterfacesHTMLTrackElementsrclangexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/track/w3c/interfaces/HTMLTrackElement/srclang-expected.txt (212146 => 212147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/w3c/interfaces/HTMLTrackElement/srclang-expected.txt        2017-02-10 21:34:27 UTC (rev 212146)
+++ trunk/LayoutTests/media/track/w3c/interfaces/HTMLTrackElement/srclang-expected.txt        2017-02-10 21:51:44 UTC (rev 212147)
</span><span class="lines">@@ -1,9 +1,9 @@
</span><span class="cx"> CONSOLE MESSAGE: line 43: The language contains a null character and is not a valid BCP 47 language tag.
</span><span class="cx"> CONSOLE MESSAGE: line 64: The language ' foo
</span><span class="cx"> ' is not a valid BCP 47 language tag.
</span><del>-CONSOLE MESSAGE: line 1380: The language ' foo
</del><ins>+CONSOLE MESSAGE: line 1409: The language ' foo
</ins><span class="cx"> ' is not a valid BCP 47 language tag.
</span><del>-CONSOLE MESSAGE: line 1380: The language contains a null character and is not a valid BCP 47 language tag.
</del><ins>+CONSOLE MESSAGE: line 1409: The language contains a null character and is not a valid BCP 47 language tag.
</ins><span class="cx">
</span><span class="cx"> PASS HTMLTrackElement.srclang missing value
</span><span class="cx"> PASS HTMLTrackElement.srclang empty string content attribute
</span></span></pre></div>
<a id="trunkLayoutTestsmediatrackw3cinterfacesTextTracklanguageexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/track/w3c/interfaces/TextTrack/language-expected.txt (212146 => 212147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/w3c/interfaces/TextTrack/language-expected.txt        2017-02-10 21:34:27 UTC (rev 212146)
+++ trunk/LayoutTests/media/track/w3c/interfaces/TextTrack/language-expected.txt        2017-02-10 21:51:44 UTC (rev 212147)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: line 1380: The language contains a null character and is not a valid BCP 47 language tag.
</del><ins>+CONSOLE MESSAGE: line 1409: The language contains a null character and is not a valid BCP 47 language tag.
</ins><span class="cx"> CONSOLE MESSAGE: line 26: The language contains a null character and is not a valid BCP 47 language tag.
</span><span class="cx">
</span><span class="cx"> PASS TextTrack.language
</span></span></pre></div>
<a id="trunkLayoutTestsresourcestestharnessjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/resources/testharness.js (212146 => 212147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/resources/testharness.js        2017-02-10 21:34:27 UTC (rev 212146)
+++ trunk/LayoutTests/resources/testharness.js        2017-02-10 21:51:44 UTC (rev 212147)
</span><span class="lines">@@ -389,7 +389,7 @@
</span><span class="cx"> self.addEventListener("connect",
</span><span class="cx"> function(message_event) {
</span><span class="cx"> this_obj._add_message_port(message_event.source);
</span><del>- });
</del><ins>+ }, false);
</ins><span class="cx"> }
</span><span class="cx"> SharedWorkerTestEnvironment.prototype = Object.create(WorkerTestEnvironment.prototype);
</span><span class="cx">
</span><span class="lines">@@ -430,7 +430,7 @@
</span><span class="cx"> this_obj._add_message_port(event.source);
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- });
</del><ins>+ }, false);
</ins><span class="cx">
</span><span class="cx"> // The oninstall event is received after the service worker script and
</span><span class="cx"> // all imported scripts have been fetched and executed. It's the
</span><span class="lines">@@ -471,6 +471,11 @@
</span><span class="cx"> self instanceof ServiceWorkerGlobalScope) {
</span><span class="cx"> return new ServiceWorkerTestEnvironment();
</span><span class="cx"> }
</span><ins>+ if ('WorkerGlobalScope' in self &&
+ self instanceof WorkerGlobalScope) {
+ return new DedicatedWorkerTestEnvironment();
+ }
+
</ins><span class="cx"> throw new Error("Unsupported test environment");
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -518,14 +523,18 @@
</span><span class="cx"> function promise_test(func, name, properties) {
</span><span class="cx"> var test = async_test(name, properties);
</span><span class="cx"> // If there is no promise tests queue make one.
</span><del>- test.step(function() {
- if (!tests.promise_tests) {
- tests.promise_tests = Promise.resolve();
- }
- });
</del><ins>+ if (!tests.promise_tests) {
+ tests.promise_tests = Promise.resolve();
+ }
</ins><span class="cx"> tests.promise_tests = tests.promise_tests.then(function() {
</span><del>- return Promise.resolve(test.step(func, test, test))
- .then(
</del><ins>+ var donePromise = new Promise(function(resolve) {
+ test.add_cleanup(resolve);
+ });
+ var promise = test.step(func, test, test);
+ test.step(function() {
+ assert_not_equals(promise, undefined);
+ });
+ Promise.resolve(promise).then(
</ins><span class="cx"> function() {
</span><span class="cx"> test.done();
</span><span class="cx"> })
</span><span class="lines">@@ -537,12 +546,13 @@
</span><span class="cx"> assert(false, "promise_test", null,
</span><span class="cx"> "Unhandled rejection with value: ${value}", {value:value});
</span><span class="cx"> }));
</span><ins>+ return donePromise;
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function promise_rejects(test, expected, promise) {
- return promise.then(test.unreached_func("Should have rejected.")).catch(function(e) {
- assert_throws(expected, function() { throw e });
</del><ins>+ function promise_rejects(test, expected, promise, description) {
+ return promise.then(test.unreached_func("Should have rejected: " + description)).catch(function(e) {
+ assert_throws(expected, function() { throw e }, description);
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -579,7 +589,7 @@
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> for (var i = 0; i < eventTypes.length; i++) {
</span><del>- watchedNode.addEventListener(eventTypes[i], eventHandler);
</del><ins>+ watchedNode.addEventListener(eventTypes[i], eventHandler, false);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -604,7 +614,7 @@
</span><span class="cx">
</span><span class="cx"> function stop_watching() {
</span><span class="cx"> for (var i = 0; i < eventTypes.length; i++) {
</span><del>- watchedNode.removeEventListener(eventTypes[i], eventHandler);
</del><ins>+ watchedNode.removeEventListener(eventTypes[i], eventHandler, false);
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -697,10 +707,17 @@
</span><span class="cx"> // instanceof doesn't work if the node is from another window (like an
</span><span class="cx"> // iframe's contentWindow):
</span><span class="cx"> // http://www.w3.org/Bugs/Public/show_bug.cgi?id=12295
</span><del>- if ("nodeType" in object &&
- "nodeName" in object &&
- "nodeValue" in object &&
- "childNodes" in object) {
</del><ins>+ try {
+ var has_node_properties = ("nodeType" in object &&
+ "nodeName" in object &&
+ "nodeValue" in object &&
+ "childNodes" in object);
+ } catch (e) {
+ // We're probably cross-origin, which means we aren't a node
+ return false;
+ }
+
+ if (has_node_properties) {
</ins><span class="cx"> try {
</span><span class="cx"> object.nodeType;
</span><span class="cx"> } catch (e) {
</span><span class="lines">@@ -713,6 +730,44 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ var replacements = {
+ "0": "0",
+ "1": "x01",
+ "2": "x02",
+ "3": "x03",
+ "4": "x04",
+ "5": "x05",
+ "6": "x06",
+ "7": "x07",
+ "8": "b",
+ "9": "t",
+ "10": "n",
+ "11": "v",
+ "12": "f",
+ "13": "r",
+ "14": "x0e",
+ "15": "x0f",
+ "16": "x10",
+ "17": "x11",
+ "18": "x12",
+ "19": "x13",
+ "20": "x14",
+ "21": "x15",
+ "22": "x16",
+ "23": "x17",
+ "24": "x18",
+ "25": "x19",
+ "26": "x1a",
+ "27": "x1b",
+ "28": "x1c",
+ "29": "x1d",
+ "30": "x1e",
+ "31": "x1f",
+ "0xfffd": "ufffd",
+ "0xfffe": "ufffe",
+ "0xffff": "uffff",
+ };
+
</ins><span class="cx"> /*
</span><span class="cx"> * Convert a value to a nice, human-readable string
</span><span class="cx"> */
</span><span class="lines">@@ -734,43 +789,9 @@
</span><span class="cx"> switch (typeof val) {
</span><span class="cx"> case "string":
</span><span class="cx"> val = val.replace("\\", "\\\\");
</span><del>- for (var i = 0; i < 32; i++) {
- var replace = "\\";
- switch (i) {
- case 0: replace += "0"; break;
- case 1: replace += "x01"; break;
- case 2: replace += "x02"; break;
- case 3: replace += "x03"; break;
- case 4: replace += "x04"; break;
- case 5: replace += "x05"; break;
- case 6: replace += "x06"; break;
- case 7: replace += "x07"; break;
- case 8: replace += "b"; break;
- case 9: replace += "t"; break;
- case 10: replace += "n"; break;
- case 11: replace += "v"; break;
- case 12: replace += "f"; break;
- case 13: replace += "r"; break;
- case 14: replace += "x0e"; break;
- case 15: replace += "x0f"; break;
- case 16: replace += "x10"; break;
- case 17: replace += "x11"; break;
- case 18: replace += "x12"; break;
- case 19: replace += "x13"; break;
- case 20: replace += "x14"; break;
- case 21: replace += "x15"; break;
- case 22: replace += "x16"; break;
- case 23: replace += "x17"; break;
- case 24: replace += "x18"; break;
- case 25: replace += "x19"; break;
- case 26: replace += "x1a"; break;
- case 27: replace += "x1b"; break;
- case 28: replace += "x1c"; break;
- case 29: replace += "x1d"; break;
- case 30: replace += "x1e"; break;
- case 31: replace += "x1f"; break;
- }
- val = val.replace(RegExp(String.fromCharCode(i), "g"), replace);
</del><ins>+ for (var p in replacements) {
+ var replace = "\\" + replacements[p];
+ val = val.replace(RegExp(String.fromCharCode(p), "g"), replace);
</ins><span class="cx"> }
</span><span class="cx"> return '"' + val.replace(/"/g, '\\"') + '"';
</span><span class="cx"> case "boolean":
</span><span class="lines">@@ -818,7 +839,12 @@
</span><span class="cx">
</span><span class="cx"> /* falls through */
</span><span class="cx"> default:
</span><del>- return typeof val + ' "' + truncate(String(val), 60) + '"';
</del><ins>+ try {
+ return typeof val + ' "' + truncate(String(val), 1000) + '"';
+ } catch(e) {
+ return ("[stringifying object threw " + String(e) +
+ " with type " + String(typeof e) + "]");
+ }
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> expose(format_value, "format_value");
</span><span class="lines">@@ -1176,6 +1202,7 @@
</span><span class="cx"> NO_MODIFICATION_ALLOWED_ERR: 'NoModificationAllowedError',
</span><span class="cx"> NOT_FOUND_ERR: 'NotFoundError',
</span><span class="cx"> NOT_SUPPORTED_ERR: 'NotSupportedError',
</span><ins>+ INUSE_ATTRIBUTE_ERR: 'InUseAttributeError',
</ins><span class="cx"> INVALID_STATE_ERR: 'InvalidStateError',
</span><span class="cx"> SYNTAX_ERR: 'SyntaxError',
</span><span class="cx"> INVALID_MODIFICATION_ERR: 'InvalidModificationError',
</span><span class="lines">@@ -1202,6 +1229,7 @@
</span><span class="cx"> NoModificationAllowedError: 7,
</span><span class="cx"> NotFoundError: 8,
</span><span class="cx"> NotSupportedError: 9,
</span><ins>+ InUseAttributeError: 10,
</ins><span class="cx"> InvalidStateError: 11,
</span><span class="cx"> SyntaxError: 12,
</span><span class="cx"> InvalidModificationError: 13,
</span><span class="lines">@@ -1226,6 +1254,7 @@
</span><span class="cx"> ReadOnlyError: 0,
</span><span class="cx"> VersionError: 0,
</span><span class="cx"> OperationError: 0,
</span><ins>+ NotAllowedError: 0
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> if (!(name in name_code_map)) {
</span><span class="lines">@@ -1436,7 +1465,7 @@
</span><span class="cx"> var args = Array.prototype.slice.call(arguments, 2);
</span><span class="cx"> return setTimeout(this.step_func(function() {
</span><span class="cx"> return f.apply(test_this, args);
</span><del>- }, timeout * tests.timeout_multiplier));
</del><ins>+ }), timeout * tests.timeout_multiplier);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Test.prototype.add_cleanup = function(callback) {
</span><span class="lines">@@ -2442,11 +2471,20 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ // 'Error.stack' is not supported in all browsers/versions
+ if (!stack) {
+ return "(Stack trace unavailable)";
+ }
+
</ins><span class="cx"> var lines = stack.split("\n");
</span><span class="cx">
</span><span class="cx"> // Create a pattern to match stack frames originating within testharness.js. These include the
</span><span class="cx"> // script URL, followed by the line/col (e.g., '/resources/testharness.js:120:21').
</span><del>- var re = new RegExp((get_script_url() || "\\btestharness.js") + ":\\d+:\\d+");
</del><ins>+ // Escape the URL per http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
+ // in case it contains RegExp characters.
+ var script_url = get_script_url();
+ var re_text = script_url ? script_url.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') : "\\btestharness.js";
+ var re = new RegExp(re_text + ":\\d+:\\d+");
</ins><span class="cx">
</span><span class="cx"> // Some browsers include a preamble that specifies the type of the error object. Skip this by
</span><span class="cx"> // advancing until we find the first stack frame originating from testharness.js.
</span><span class="lines">@@ -2634,7 +2672,7 @@
</span><span class="cx">
</span><span class="cx"> var tests = new Tests();
</span><span class="cx">
</span><del>- addEventListener("error", function(e) {
</del><ins>+ var error_handler = function(e) {
</ins><span class="cx"> if (tests.file_is_test) {
</span><span class="cx"> var test = tests.tests[0];
</span><span class="cx"> if (test.phase >= test.phases.HAS_RESULT) {
</span><span class="lines">@@ -2649,8 +2687,11 @@
</span><span class="cx"> tests.status.message = e.message;
</span><span class="cx"> tests.status.stack = e.stack;
</span><span class="cx"> }
</span><del>- });
</del><ins>+ };
</ins><span class="cx">
</span><ins>+ addEventListener("error", error_handler, false);
+ addEventListener("unhandledrejection", function(e){ error_handler(e.reason); }, false);
+
</ins><span class="cx"> test_environment.on_tests_ready();
</span><span class="cx">
</span><span class="cx"> })();
</span></span></pre></div>
<a id="trunkLayoutTestsstreamsshadowingPromiseexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/streams/shadowing-Promise-expected.txt (212146 => 212147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/shadowing-Promise-expected.txt        2017-02-10 21:34:27 UTC (rev 212146)
+++ trunk/LayoutTests/streams/shadowing-Promise-expected.txt        2017-02-10 21:51:44 UTC (rev 212147)
</span><span class="lines">@@ -9,5 +9,4 @@
</span><span class="cx"> PASS Streams should not directly use Number and related methods
</span><span class="cx"> PASS Streams should not directly use ReadableStream public APIs
</span><span class="cx"> PASS Streams should not directly use ReadableStreamDefaultReader read public API
</span><del>-PASS Streams should not directly use array public APIs
</del><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsstreamsshadowingPromisehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/streams/shadowing-Promise.html (212146 => 212147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/shadowing-Promise.html        2017-02-10 21:34:27 UTC (rev 212146)
+++ trunk/LayoutTests/streams/shadowing-Promise.html        2017-02-10 21:51:44 UTC (rev 212147)
</span><span class="lines">@@ -149,58 +149,4 @@
</span><span class="cx"> assert_unreached("test should not throw");
</span><span class="cx"> }
</span><span class="cx"> }, 'Streams should not directly use ReadableStreamDefaultReader read public API');
</span><del>-
-promise_test(function() {
- const ArrayPushBackup = Array.prototype.push;
- const ArrayShiftBackup = Array.prototype.shift;
-
- // Use of testing variable to try not messing up testharness.js code.
- // FIXME: this approach is far from perfect: push is used in case an assert fails.
- // But cleanTest will not be called and we may end-up mask the real assertion failure by below assert_unreached messages.
- // We might want to either improve testharness.js or move these tests out of testharness.js.
- let testing = true;
- Array.prototype.push = function() {
- if (testing) {
- testing = false;
- assert_unreached("Array.prototype.push called");
- }
- return ArrayPushBackup.apply(this, arguments);
- }
-
- Array.prototype.shift = function() {
- if (testing) {
- testing = false;
- assert_unreached("Array.prototype.shift called");
- }
- return ArrayShiftBackup.call(this, arguments);
- }
-
- function cleanTest() {
- Array.prototype.push = ArrayPushBackup;
- Array.prototype.shift = ArrayShiftBackup;
- }
- try {
- let _controller;
- const reader = new ReadableStream({
- start: function(controller) {
- _controller = controller;
- }
- }).getReader();
- // checking whether pushing/shifting pending read promises is shielded.
- const readPromise = reader.read().then(function(result) {
- assert_equals(result.value, "half baked potato");
- // checking whether pushing/shifting enqueued values is shielded.
- _controller.enqueue("fully baked potato");
- return reader.read().then(function(result) {
- assert_equals(result.value, "fully baked potato");
- cleanTest();
- }, cleanTest);
- }, cleanTest);
- _controller.enqueue("half baked potato");
- return readPromise;
- } catch (error) {
- cleanTest();
- return Promise.reject(error);
- }
-}, 'Streams should not directly use array public APIs');
</del><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsstreamsstreamspublicarrayapiexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/streams/streams-public-array-api-expected.txt (0 => 212147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/streams-public-array-api-expected.txt         (rev 0)
+++ trunk/LayoutTests/streams/streams-public-array-api-expected.txt        2017-02-10 21:51:44 UTC (rev 212147)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Streams should not directly use array public APIs
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS result.value is "half baked potato"
+PASS result.value is "fully baked potato"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstreamsstreamspublicarrayapihtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/streams/streams-public-array-api.html (0 => 212147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/streams-public-array-api.html         (rev 0)
+++ trunk/LayoutTests/streams/streams-public-array-api.html        2017-02-10 21:51:44 UTC (rev 212147)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+<!DOCTYPE html>
+<body>
+<script src="../resources/js-test-pre.js"></script>
+<script>
+ description("Streams should not directly use array public APIs");
+ jsTestIsAsync = true;
+
+ const ArrayPushBackup = Array.prototype.push;
+ const ArrayShiftBackup = Array.prototype.shift;
+
+ Array.prototype.push = function() {
+ testFailed("Array.prototype.push called");
+ }
+
+ Array.prototype.shift = function() {
+ testFailed("Array.prototype.shift called");
+ }
+
+ function cleanAndFinishTest() {
+ Array.prototype.push = ArrayPushBackup;
+ Array.prototype.shift = ArrayShiftBackup;
+ finishJSTest();
+ }
+
+ try {
+ let _controller;
+ const reader = new ReadableStream({
+ start: function(controller) {
+ _controller = controller;
+ }
+ }).getReader();
+
+ // checking whether pushing/shifting pending read promises is shielded.
+ const readPromise = reader.read().then(function(_result) {
+ result = _result;
+ shouldBeEqualToString("result.value", "half baked potato");
+ // checking whether pushing/shifting enqueued values is shielded.
+ _controller.enqueue("fully baked potato");
+ return reader.read().then(function(_result) {
+ result = _result;
+ shouldBeEqualToString("result.value", "fully baked potato");
+ cleanAndFinishTest();
+ }, cleanAndFinishTest);
+ }, cleanAndFinishTest);
+ _controller.enqueue("half baked potato");
+ } catch (error) {
+ testFailed("Exception thrown: " + error);
+ cleanAndFinishTest();
+ }
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
</ins></span></pre>
</div>
</div>
</body>
</html>