Diff
Modified: trunk/LayoutTests/ChangeLog (208003 => 208004)
--- trunk/LayoutTests/ChangeLog 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/ChangeLog 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,3 +1,40 @@
+2016-10-27 Chris Dumez <cdu...@apple.com>
+
+ Sync up all copies of testharnessreport.js
+ https://bugs.webkit.org/show_bug.cgi?id=164071
+
+ Reviewed by Youenn Fablet.
+
+ Sync up all copies of testharnessreport.js for consistency.
+
+ * http/tests/media/media-source/mediasource-play-then-seek-back-with-remote-control-expected.txt:
+ * http/tests/security/cross-origin-css-in-quirks-1-expected.txt:
+ * http/tests/security/cross-origin-css-in-quirks-2-expected.txt:
+ * http/tests/security/cross-origin-css-in-quirks-3-expected.txt:
+ * http/tests/security/cross-origin-css-in-quirks-4-expected.txt:
+ * http/tests/security/same-origin-css-1-expected.txt:
+ * http/tests/security/same-origin-css-2-expected.txt:
+ * http/tests/security/same-origin-css-3-expected.txt:
+ * http/tests/security/same-origin-css-in-quirks-expected.txt:
+ * http/tests/w3c/resources/testharnessreport.js:
+ (convertResult):
+ (self.testRunner.add_completion_callback.):
+ (self.testRunner.add_completion_callback):
+ (add_completion_callback.sanitize): Deleted.
+ (add_completion_callback): Deleted.
+ * imported/blink/http/tests/resources/testharnessreport.js:
+ (convertResult):
+ (self.testRunner.add_completion_callback.):
+ (self.testRunner.add_completion_callback):
+ (isCSSWGTest): Deleted.
+ (isJSTest): Deleted.
+ (add_completion_callback.sanitize): Deleted.
+ (add_completion_callback.done): Deleted.
+ (add_completion_callback): Deleted.
+ * resources/testharnessreport.js:
+ (self.testRunner.add_completion_callback.):
+ (self.testRunner.add_completion_callback):
+
2016-10-25 Brent Fulgham <bfulg...@apple.com>
Prevent hit tests from being performed on an invalid render tree
Modified: trunk/LayoutTests/http/tests/media/media-source/mediasource-play-then-seek-back-with-remote-control-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/media/media-source/mediasource-play-then-seek-back-with-remote-control-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/media/media-source/mediasource-play-then-seek-back-with-remote-control-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,3 +1,3 @@
-
+
PASS Test playing then seeking back with remote control command.(PASS if no crash)
Modified: trunk/LayoutTests/http/tests/security/cross-origin-css-1-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/cross-origin-css-1-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/cross-origin-css-1-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,5 +1,5 @@
CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url="" because non CSS MIME types are not allowed in strict mode.
PASS Testing cross-origin and MIME behavior for CSS.
-PASS xorigincss1.html should not be loaded via <link>.
+PASS xorigincss1.html should not be loaded via <link>.
Modified: trunk/LayoutTests/http/tests/security/cross-origin-css-2-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/cross-origin-css-2-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/cross-origin-css-2-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,5 +1,5 @@
CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url="" because non CSS MIME types are not allowed in strict mode.
PASS Testing cross-origin and MIME behavior for CSS.
-PASS xorigincss2.html should not be loaded either via <link> or @import.
+PASS xorigincss2.html should not be loaded either via <link> or @import.
Modified: trunk/LayoutTests/http/tests/security/cross-origin-css-3-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/cross-origin-css-3-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/cross-origin-css-3-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,4 +1,4 @@
PASS Testing cross-origin and MIME behavior for CSS.
-PASS xorigincss1.css should be loaded via <link>
+PASS xorigincss1.css should be loaded via <link>
Modified: trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,5 +1,5 @@
CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url="" because non CSS MIME types are not allowed for cross-origin stylesheets.
PASS Testing cross-origin and MIME behavior for CSS.
-PASS xorigincss1.html should not be loaded via <link>.
+PASS xorigincss1.html should not be loaded via <link>.
Modified: trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,5 +1,5 @@
CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url="" because non CSS MIME types are not allowed for cross-origin stylesheets.
PASS Testing cross-origin and MIME behavior for CSS.
-PASS xorigincss2.html should not be loaded either via <link> or @import.
+PASS xorigincss2.html should not be loaded either via <link> or @import.
Modified: trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,4 +1,4 @@
PASS Testing cross-origin and MIME behavior for CSS.
-PASS xorigincss1.css should be loaded via <link>
+PASS xorigincss1.css should be loaded via <link>
Modified: trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,4 +1,4 @@
PASS Testing cross-origin and MIME behavior for CSS.
-PASS xorigincss3.html should be loaded via <link>
+PASS xorigincss3.html should be loaded via <link>
Modified: trunk/LayoutTests/http/tests/security/same-origin-css-1-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/same-origin-css-1-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/same-origin-css-1-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,5 +1,5 @@
CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url="" because non CSS MIME types are not allowed in strict mode.
PASS Testing same-origin and MIME behavior for CSS.
-PASS xorigincss1.html should not be loaded via <link>.
+PASS xorigincss1.html should not be loaded via <link>.
Modified: trunk/LayoutTests/http/tests/security/same-origin-css-2-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/same-origin-css-2-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/same-origin-css-2-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,5 +1,5 @@
CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url="" because non CSS MIME types are not allowed in strict mode.
PASS Testing same-origin and MIME behavior for CSS.
-PASS xorigincss2.html should not be loaded either via <link> or @import.
+PASS xorigincss2.html should not be loaded either via <link> or @import.
Modified: trunk/LayoutTests/http/tests/security/same-origin-css-3-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/same-origin-css-3-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/same-origin-css-3-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,4 +1,4 @@
PASS Testing same-origin and MIME behavior for CSS.
-PASS xorigincss1.css should be loaded via <link>
+PASS xorigincss1.css should be loaded via <link>
Modified: trunk/LayoutTests/http/tests/security/same-origin-css-in-quirks-expected.txt (208003 => 208004)
--- trunk/LayoutTests/http/tests/security/same-origin-css-in-quirks-expected.txt 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/security/same-origin-css-in-quirks-expected.txt 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,9 +1,9 @@
PASS background image loaded
PASS Testing same-origin and MIME behavior for CSS.
-PASS xorigincss1.html should be loaded via <link>.
-PASS xorigincss2.html should be loaded either via <link> or @import.
-PASS xorigincss1.css should be loaded via <link>
+PASS xorigincss1.html should be loaded via <link>.
+PASS xorigincss2.html should be loaded either via <link> or @import.
+PASS xorigincss1.css should be loaded via <link>
PASS xorigincss3.html should be loaded
PASS xorigincss4.html should be loaded via @import.
PASS xorigincss2.css should be loaded.
Modified: trunk/LayoutTests/http/tests/w3c/resources/testharnessreport.js (208003 => 208004)
--- trunk/LayoutTests/http/tests/w3c/resources/testharnessreport.js 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/http/tests/w3c/resources/testharnessreport.js 2016-10-27 21:14:50 UTC (rev 208004)
@@ -2,10 +2,9 @@
* This file is intended for vendors to implement
* code needed to integrate testharness.js tests with their own test systems.
*
- * Typically test system integration will attach callbacks when each test has
- * run, using add_result_callback(callback(test)), or when the whole test file
- * has completed, using
- * add_completion_callback(callback(tests, harness_status)).
+ * Typically such integration will attach callbacks when each test is
+ * has run, using add_result_callback(callback(test)), or when the whole test file has
+ * completed, using add_completion_callback(callback(tests, harness_status)).
*
* For more documentation about the callback functions and the
* parameters they are called with see testharness.js
@@ -15,77 +14,80 @@
if (self.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
+ testRunner.setCanOpenWindows();
+ // Let's restrict calling testharness timeout() to wptserve tests for the moment.
+ // That will limit the impact to a small number of tests.
+ // The risk is that testharness timeout() might be called to late on slow bots to finish properly.
+ if (testRunner.timeout && location.port == 8800)
+ setTimeout(timeout, testRunner.timeout * 0.9);
}
// Function used to convert the test status code into
// the corresponding string
-function convertResult(resultStatus){
- if(resultStatus == 0)
- return("PASS");
- else if(resultStatus == 1)
- return("FAIL");
- else if(resultStatus == 2)
- return("TIMEOUT");
- else
- return("NOTRUN");
+function convertResult(resultStatus)
+{
+ if(resultStatus == 0)
+ return("PASS");
+ else if(resultStatus == 1)
+ return("FAIL");
+ else if(resultStatus == 2)
+ return("TIMEOUT");
+ else
+ return("NOTRUN");
}
-/* Disable the default output of testharness.js. The default output formats
-* test results into an HTML table. When that table is dumped as text, no
-* spacing between cells is preserved, and it is therefore not readable. By
-* setting output to false, the HTML table will not be created
-*/
-setup({"output":false});
+if (self.testRunner) {
+ /* Disable the default output of testharness.js. The default output formats
+ * test results into an HTML table. When that table is dumped as text, no
+ * spacing between cells is preserved, and it is therefore not readable. By
+ * setting output to false, the HTML table will not be created
+ */
+ setup({"output": false, "explicit_timeout": true});
-/* Using a callback function, test results will be added to the page in a
-* manner that allows dumpAsText to produce readable test results
-*/
-add_completion_callback(function (tests, harness_status){
-
- // Create element to hold results
- var results = document.createElement("pre");
-
- // Declare result string
- var resultStr = "\n";
+ /* Using a callback function, test results will be added to the page in a
+ * manner that allows dumpAsText to produce readable test results
+ */
+ add_completion_callback(function (tests, harness_status) {
+ // Wait for any other completion callbacks
+ setTimeout(function() {
+ var results = document.createElement("pre");
+ var resultStr = "\n";
- // Sanitizes the given text for display in test results.
- function sanitize(text) {
- if (!text) {
- return "";
+ // Sanitizes the given text for display in test results.
+ function sanitize(text) {
+ if (!text) {
+ return "";
+ }
+ text = text.replace(/\0/g, "\\0");
+ return text.replace(/\r/g, "\\r");
}
- // Escape null characters, otherwise diff will think the file is binary.
- text = text.replace(/\0/g, "\\0");
- // Escape carriage returns as they break rietveld's difftools.
- return text.replace(/\r/g, "\\r");
- }
-
- // Check harness_status. If it is not 0, tests did not
- // execute correctly, output the error code and message
- if(harness_status.status != 0){
- resultStr += "Harness Error. harness_status.status = " +
- harness_status.status +
- " , harness_status.message = " +
- harness_status.message;
- }
- else {
- // Iterate through tests array and build string that contains
- // results for all tests
- for(var i=0; i<tests.length; i++){
- resultStr += convertResult(tests[i].status) + " " +
- sanitize(tests[i].name) + " " +
- sanitize(tests[i].message) + "\n";
- }
- }
+ if(harness_status.status != 0)
+ resultStr += "Harness Error (" + convertResult(harness_status.status) + "), message = " + harness_status.message + "\n\n";
- // Set results element's innerHTML to the results string
- results.innerHTML = resultStr;
+ for (var i = 0; i < tests.length; i++) {
+ var message = sanitize(tests[i].message);
+ if (tests[i].status == 1 && !tests[i].dumpStack) {
+ // Remove stack for failed tests for proper string comparison without file paths.
+ // For a test to dump the stack set its dumpStack attribute to true.
+ var stackIndex = message.indexOf("(stack:");
+ if (stackIndex > 0)
+ message = message.substr(0, stackIndex);
+ }
+ resultStr += convertResult(tests[i].status) + " " + sanitize(tests[i].name) + " " + message + "\n";
+ }
- // Add results element to document
- document.body.appendChild(results);
+ results.innerText = resultStr;
+ var log = document.getElementById("log");
+ if (log)
+ log.appendChild(results);
+ else
+ document.body.appendChild(results);
- if (self.testRunner)
- testRunner.notifyDone();
-});
+ testRunner.notifyDone();
+ }, 0);
+ });
-// vim: set expandtab shiftwidth=4 tabstop=4:
+ if (window.internals)
+ window.internals.setResourceTimingSupport(true);
+}
Modified: trunk/LayoutTests/imported/blink/http/tests/resources/testharnessreport.js (208003 => 208004)
--- trunk/LayoutTests/imported/blink/http/tests/resources/testharnessreport.js 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/imported/blink/http/tests/resources/testharnessreport.js 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,7 +1,5 @@
/*
- * THIS FILE INTENTIONALLY LEFT BLANK
- *
- * More specifically, this file is intended for vendors to implement
+ * This file is intended for vendors to implement
* code needed to integrate testharness.js tests with their own test systems.
*
* Typically such integration will attach callbacks when each test is
@@ -17,12 +15,17 @@
testRunner.dumpAsText();
testRunner.waitUntilDone();
testRunner.setCanOpenWindows();
- testRunner.setCloseRemainingWindowsWhenComplete(true);
+ // Let's restrict calling testharness timeout() to wptserve tests for the moment.
+ // That will limit the impact to a small number of tests.
+ // The risk is that testharness timeout() might be called to late on slow bots to finish properly.
+ if (testRunner.timeout && location.port == 8800)
+ setTimeout(timeout, testRunner.timeout * 0.9);
}
// Function used to convert the test status code into
// the corresponding string
-function convertResult(resultStatus) {
+function convertResult(resultStatus)
+{
if(resultStatus == 0)
return("PASS");
else if(resultStatus == 1)
@@ -33,99 +36,58 @@
return("NOTRUN");
}
-/* Disable the default output of testharness.js. The default output formats
-* test results into an HTML table. When that table is dumped as text, no
-* spacing between cells is preserved, and it is therefore not readable. By
-* setting output to false, the HTML table will not be created
-*/
-setup({"output":false});
+if (self.testRunner) {
+ /* Disable the default output of testharness.js. The default output formats
+ * test results into an HTML table. When that table is dumped as text, no
+ * spacing between cells is preserved, and it is therefore not readable. By
+ * setting output to false, the HTML table will not be created
+ */
+ setup({"output": false, "explicit_timeout": true});
-/* If the test has a meta tag named flags and the content contains "dom", then it's a CSSWG test.
- */
-function isCSSWGTest() {
- var flags = document.querySelector('meta[name=flags]'),
- content = flags ? flags.getAttribute('content') : null;
+ /* Using a callback function, test results will be added to the page in a
+ * manner that allows dumpAsText to produce readable test results
+ */
+ add_completion_callback(function (tests, harness_status) {
+ // Wait for any other completion callbacks
+ setTimeout(function() {
+ var results = document.createElement("pre");
+ var resultStr = "\n";
- return content && content.match(/\bdom\b/);
-}
+ // Sanitizes the given text for display in test results.
+ function sanitize(text) {
+ if (!text) {
+ return "";
+ }
+ text = text.replace(/\0/g, "\\0");
+ return text.replace(/\r/g, "\\r");
+ }
-function isJSTest() {
- return !!document.querySelector('script[src*="/resources/testharness"]');
-}
+ if(harness_status.status != 0)
+ resultStr += "Harness Error (" + convertResult(harness_status.status) + "), message = " + harness_status.message + "\n\n";
-/* Using a callback function, test results will be added to the page in a
-* manner that allows dumpAsText to produce readable test results
-*/
-add_completion_callback(function (tests, harness_status) {
-
- // Create element to hold results
- var results = document.createElement("pre");
-
- // Declare result string
- var resultStr = "This is a testharness.js-based test.\n";
-
- // Sanitizes the given text for display in test results.
- function sanitize(text) {
- if (!text) {
- return "";
- }
- // Escape null characters, otherwise diff will think the file is binary.
- text = text.replace(/\0/g, "\\0");
- // Escape carriage returns as they break rietveld's difftools.
- return text.replace(/\r/g, "\\r");
- }
-
- // Check harness_status. If it is not 0, tests did not
- // execute correctly, output the error code and message
- if (harness_status.status != 0) {
- resultStr += "Harness Error. harness_status.status = " +
- harness_status.status +
- " , harness_status.message = " +
- harness_status.message +
- "\n";
- } else {
- // Iterate through tests array and build string that contains
- // results for all tests
- for (var i = 0; i < tests.length; i++) {
- resultStr += convertResult(tests[i].status) + " " +
- sanitize(tests[i].name) + " " +
- sanitize(tests[i].message) + "\n";
- }
- }
- resultStr += "Harness: the test ran to completion.\n";
-
- // Set results element's textContent to the results string
- results.textContent = resultStr;
-
- function done() {
- if (self.testRunner) {
- var logDiv = document.getElementById('log');
- if ((isCSSWGTest() || isJSTest()) && logDiv) {
- // Assume it's a CSSWG style test, and anything other than the log div isn't
- // material to the testrunner output, so should be hidden from the text dump
- var next = null;
- for (var child = document.body.firstChild; child; child = next) {
- next = child.nextSibling;
- if (child.nodeType == Node.ELEMENT_NODE)
- child.style.visibility = "hidden";
- else if (child.nodeType == Node.TEXT_NODE)
- document.body.removeChild(child);
+ for (var i = 0; i < tests.length; i++) {
+ var message = sanitize(tests[i].message);
+ if (tests[i].status == 1 && !tests[i].dumpStack) {
+ // Remove stack for failed tests for proper string comparison without file paths.
+ // For a test to dump the stack set its dumpStack attribute to true.
+ var stackIndex = message.indexOf("(stack:");
+ if (stackIndex > 0)
+ message = message.substr(0, stackIndex);
}
+ resultStr += convertResult(tests[i].status) + " " + sanitize(tests[i].name) + " " + message + "\n";
}
- }
- // Add results element to document.
- if (!document.body)
- document.documentElement.appendChild(document.createElement("body"));
- document.body.appendChild(results);
+ results.innerText = resultStr;
+ var log = document.getElementById("log");
+ if (log)
+ log.appendChild(results);
+ else
+ document.body.appendChild(results);
- if (self.testRunner)
testRunner.notifyDone();
- }
+ }, 0);
+ });
- if (document.readyState === 'loading') {
- window.addEventListener('load', done);
- } else {
- setTimeout(done, 0);
- }
-});
+ if (window.internals)
+ window.internals.setResourceTimingSupport(true);
+}
Modified: trunk/LayoutTests/resources/testharnessreport.js (208003 => 208004)
--- trunk/LayoutTests/resources/testharnessreport.js 2016-10-27 20:56:17 UTC (rev 208003)
+++ trunk/LayoutTests/resources/testharnessreport.js 2016-10-27 21:14:50 UTC (rev 208004)
@@ -1,7 +1,5 @@
/*
- * THIS FILE INTENTIONALLY LEFT BLANK
- *
- * More specifically, this file is intended for vendors to implement
+ * This file is intended for vendors to implement
* code needed to integrate testharness.js tests with their own test systems.
*
* Typically such integration will attach callbacks when each test is
@@ -60,9 +58,7 @@
if (!text) {
return "";
}
- // Escape null characters, otherwise diff will think the file is binary.
text = text.replace(/\0/g, "\\0");
- // Escape carriage returns as they break rietveld's difftools.
return text.replace(/\r/g, "\\r");
}