Update web-platform-tests to revision 68a256f49be380ca4add535ce8ece9de28820e6b

This commit is contained in:
WPT Sync Bot 2018-02-04 20:08:48 -05:00
parent e54935c25a
commit cd5bf022bd
178 changed files with 6082 additions and 795 deletions

View file

@ -12,19 +12,12 @@
<script>
setup({explicit_done: true});
// explicitly test the namespace before we start testing
test_namespace("getEntriesByType");
var d;
var iframe;
var iframeBody;
var image;
var random = Math.random();
// Explicitly test the namespace before we start testing.
test_namespace('getEntriesByType');
let iframe;
function setup_iframe() {
iframe = document.getElementById('frameContext');
d = iframe.contentWindow.document;
iframeBody = d.body;
iframe.addEventListener('load', onload_test, false);
}
function onload_test() {
@ -32,15 +25,22 @@ function onload_test() {
done();
return;
}
var context = new PerformanceContext(iframe.contentWindow.performance);
var entries = context.getEntriesByType('resource');
if(entries.length > 0) {
entry = entries[0];
test_not_equals((entry.redirectStart + entry.redirectEnd + entry.domainLookupStart + entry.domainLookupEnd + entry.connectStart + entry.connectEnd + entry.secureConnectionStart + entry.requestStart + entry.responseStart), 0, 'redirectStart, redirectEnd, domainLookupStart, domainLookupEnd, connectStart, connectEnd, secureConnectionStart, requestStart, and responseStart -- should NOT be all returned as 0 when the value of Timing-Allow-Origin is a case-sensitive match for the value of the origin of the current document and TAO algorithm passes');
}
const context = new PerformanceContext(iframe.contentWindow.performance);
const entries = context.getEntriesByType('resource');
test_equals(entries.length, 1, 'The iframe should have one resource timing entry.');
const entry = entries[0];
test_equals(entry.redirectStart, 0, 'redirectStart should be 0 in cross-origin request since no redirect.');
test_equals(entry.redirectEnd, 0, 'redirectEnd should be 0 in cross-origin request since no redirect.');
test_greater_than(entry.domainLookupStart, 0, 'domainLookupStart should not be 0 in timing-allow cross-origin request.');
test_greater_than(entry.domainLookupEnd, 0, 'domainLookupEnd should not be 0 in timing-allow cross-origin request.');
test_greater_than(entry.connectStart, 0, 'connectStart should not be 0 in timing-allow cross-origin request.');
test_greater_than(entry.connectEnd, 0, 'connectEnd should not be 0 in timing-allow cross-origin request.');
test_greater_than(entry.requestStart, 0, 'requestStart should not be 0 in timing-allow cross-origin request.');
test_greater_than(entry.responseStart, 0, 'responseStart should not be 0 in timing-allow cross-origin request.');
test_equals(entry.secureConnectionStart, 0, 'secureConnectionStart should be 0 in cross-origin request since no ssl!');
test_greater_than(entry.fetchStart, 0, 'fetchStart should not be 0 in timing-allow cross-origin request.');
test_greater_than(entry.responseEnd, 0, 'responseEnd should not be 0 in timing-allow cross-origin request.');
done();
}
window.setup_iframe = setup_iframe;

View file

@ -13,18 +13,11 @@
setup({explicit_done: true});
// explicitly test the namespace before we start testing
test_namespace("getEntriesByType");
var d;
var iframe;
var iframeBody;
var image;
var random = Math.random();
test_namespace('getEntriesByType');
let iframe;
function setup_iframe() {
iframe = document.getElementById('frameContext');
d = iframe.contentWindow.document;
iframeBody = d.body;
iframe.addEventListener('load', onload_test, false);
}
function onload_test() {
@ -32,15 +25,21 @@ function onload_test() {
done();
return;
}
var context = new PerformanceContext(iframe.contentWindow.performance);
var entries = context.getEntriesByType('resource');
if(entries.length > 0) {
entry = entries[0];
test_equals((entry.redirectStart + entry.redirectEnd + entry.domainLookupStart + entry.domainLookupEnd + entry.connectStart + entry.connectEnd + entry.secureConnectionStart + entry.requestStart + entry.responseStart), 0, "redirectStart, redirectEnd, domainLookupStart, domainLookupEnd, connectStart, connectEnd, secureConnectionStart, requestStart, and responseStart -- should be all returned as 0 when the HTTP response includes zero Timing-Allow-Origin header value and TAO algorithm fails");
}
const context = new PerformanceContext(iframe.contentWindow.performance);
const entries = context.getEntriesByType('resource');
test_equals(entries.length, 1, 'There should be one resource timing entry.');
const entry = entries[0];
test_equals(entry.redirectStart, 0, 'redirectStart should be 0 in cross-origin request.');
test_equals(entry.redirectEnd, 0, 'redirectEnd should be 0 in cross-origin request.');
test_equals(entry.domainLookupStart, 0, 'domainLookupStart should be 0 in cross-origin request.');
test_equals(entry.domainLookupEnd, 0, 'domainLookupEnd should be 0 in cross-origin request.');
test_equals(entry.connectStart, 0, 'connectStart should be 0 in cross-origin request.');
test_equals(entry.connectEnd, 0, 'connectEnd should be 0 in cross-origin request.');
test_equals(entry.requestStart, 0, 'requestStart should be 0 in cross-origin request.');
test_equals(entry.responseStart, 0, 'responseStart should be 0 in cross-origin request.');
test_equals(entry.secureConnectionStart, 0, 'secureConnectionStart should be 0 in cross-origin request.');
test_greater_than(entry.fetchStart, 0, 'fetchStart should be greater than 0 in cross-origin request.');
test_greater_than(entry.responseEnd, 0, 'responseEnd should be greater than 0 in cross-origin request.');
done();
}
window.setup_iframe = setup_iframe;