mirror of
https://github.com/servo/servo.git
synced 2025-08-26 23:58:20 +01:00
Update web-platform-tests to revision e87f38097902e16348d4e17f4fe3bc2d0112bff1
This commit is contained in:
parent
2f8fa32e91
commit
db5631a086
381 changed files with 11610 additions and 4232 deletions
|
@ -1,37 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Resource Timing frame initiator type</title>
|
||||
<link rel="author" title="Google" href="http://www.google.com/" />
|
||||
<link rel="help" href="http://www.w3.org/TR/resource-timing/#dom-performanceresourcetiming-initiatortype"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/webperftestharness.js"></script>
|
||||
<script src="resources/webperftestharnessextension.js"></script>
|
||||
<script>
|
||||
setup({explicit_done: true});
|
||||
|
||||
function onload_test() {
|
||||
const iframe = document.getElementById('frameContext');
|
||||
const context = new PerformanceContext(iframe.contentWindow.performance);
|
||||
const entries = context.getEntriesByType('resource');
|
||||
|
||||
const index = window.location.pathname.lastIndexOf('/');
|
||||
const pathname = window.location.pathname.substring(0, index) +
|
||||
'/resources/blank_page_green.htm';
|
||||
const expected_entries = {};
|
||||
expected_entries[pathname] = 'frame';
|
||||
|
||||
test_resource_entries(entries, expected_entries);
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Description</h1>
|
||||
<p>This test validates that the frame initiator type is represented.</p>
|
||||
<div id="log"></div>
|
||||
<iframe id="frameContext" onload="onload_test();" src="resources/green_frame.htm" style="width: 250px; height: 250px;"></iframe>
|
||||
</body>
|
||||
</html>
|
|
@ -18,6 +18,7 @@ let ol_font_loaded = false;
|
|||
let ul_font_loaded = false;
|
||||
let xhr_loaded = false;
|
||||
let tests_run = false;
|
||||
let frameset_loaded = false;
|
||||
|
||||
function check_finished() {
|
||||
if (!ul_font_loaded) {
|
||||
|
@ -26,7 +27,7 @@ function check_finished() {
|
|||
if (!ol_font_loaded) {
|
||||
ol_font_loaded = check_font_loaded('ol');
|
||||
}
|
||||
if (page_loaded && ol_font_loaded && ul_font_loaded && background_loaded && xhr_loaded) {
|
||||
if (page_loaded && ol_font_loaded && ul_font_loaded && background_loaded && xhr_loaded && frameset_loaded) {
|
||||
perform_test();
|
||||
} else {
|
||||
step_timeout(check_finished, 100);
|
||||
|
@ -64,40 +65,88 @@ function onload_test() {
|
|||
step_timeout(check_finished, 100);
|
||||
}
|
||||
|
||||
function frameset_onload() {
|
||||
frameset_loaded = true;
|
||||
|
||||
step_timeout(check_finished, 100);
|
||||
}
|
||||
|
||||
function perform_test() {
|
||||
if (tests_run) {
|
||||
return;
|
||||
}
|
||||
tests_run = true;
|
||||
const context = new PerformanceContext(document.getElementById('frameContext').contentWindow.performance);
|
||||
const entries = context.getEntriesByType('resource');
|
||||
let entries = context.getEntriesByType('resource');
|
||||
|
||||
// check for frameset
|
||||
if (document.getElementById('frameContext2') &&
|
||||
document.getElementById('frameContext2').contentWindow) {
|
||||
const context2 = new PerformanceContext(document.getElementById('frameContext2').contentWindow.performance);
|
||||
entries = entries.concat(context2.getEntriesByType('resource'));
|
||||
}
|
||||
|
||||
const index = window.location.pathname.lastIndexOf('/');
|
||||
const pathname = window.location.pathname.substring(0, index) + '/resources/';
|
||||
const font_pathname = window.location.pathname.substring(0, index - 15) + 'fonts/Ahem.ttf';
|
||||
|
||||
let expected_entries = {};
|
||||
expected_entries[font_pathname] = 'css';
|
||||
expected_entries[pathname + 'resource_timing_test0.png'] = 'img';
|
||||
expected_entries[pathname + 'blank_page_green.htm'] = 'iframe';
|
||||
expected_entries[pathname + 'empty_script.js'] = 'script';
|
||||
expected_entries[pathname + 'resource_timing_test0.css?id=embed'] = 'embed';
|
||||
expected_entries[pathname + 'resource_timing_test0.css?id=n1'] = 'css';
|
||||
expected_entries[font_pathname + '?id=n1'] = 'css';
|
||||
expected_entries[pathname + 'blue.png?id=1'] = 'css';
|
||||
expected_entries[pathname + 'blue.png?id=2'] = 'css';
|
||||
expected_entries[pathname + 'blue.png?id=async_xhr'] = 'xmlhttprequest';
|
||||
expected_entries[pathname + 'blue.png?id=body'] = 'body';
|
||||
expected_entries[pathname + 'blue.png?id=input'] = 'input';
|
||||
expected_entries[pathname + 'blue.png?id=n1'] = 'css';
|
||||
expected_entries[pathname + 'blue.png?id=object'] = 'object';
|
||||
expected_entries[pathname + 'blue.png?id=poster'] = 'video';
|
||||
expected_entries[pathname + 'nested.css'] = 'link';
|
||||
addEntryIfExists(entries, expected_entries, font_pathname, 'css');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.png', 'img');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.png?id=srcset-srcset', 'img');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.png?id=srcset-src', 'img');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blank_page_green.htm', 'iframe');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blank_page_green.htm?id=frame', 'frame');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'empty_script.js', 'script');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.css?id=embed', 'embed');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.css?id=n1', 'css');
|
||||
addEntryIfExists(entries, expected_entries, font_pathname + '?id=n1', 'css');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=cursor', 'css');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=1', 'css');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=2', 'css');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=async_xhr', 'xmlhttprequest');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=body', 'body');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=input', 'input');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=n1', 'css');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=object', 'object');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=video-poster', 'video');
|
||||
addEntryIfExists(entries, expected_entries, '/media/test.mp4?id=video-src', 'video');
|
||||
addEntryIfExists(entries, expected_entries, '/media/test.mp4?id=video-source', 'source');
|
||||
addEntryIfExists(entries, expected_entries, '/media/test.ogg?id=video-source', 'source');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=video-track', 'track');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=audio-src', 'audio');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=audio-source-wav', 'source');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=audio-source-mpeg', 'source');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=audio-source-ogg', 'source');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=picture-source', 'source');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=picture-img', 'img');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=picture-notsupported-img', 'img');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=picture-img-src', 'img');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=picture-img-srcset', 'img');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=picture-99x-img-src', 'img');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=svg-image', 'image');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'nested.css', 'link');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'nested.css?id=prefetch', 'link');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'nested.css?id=preload', 'link');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'blank_page_green.htm?id=prerender', 'link');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'manifest.json', 'link');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=beacon', 'beacon');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=fetch', 'fetch');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'empty.py?favicon', 'link');
|
||||
addEntryIfExists(entries, expected_entries, pathname + 'eventsource.py?id=eventsource', 'eventsource');
|
||||
|
||||
test_resource_entries(entries, expected_entries);
|
||||
done();
|
||||
}
|
||||
|
||||
function addEntryIfExists(entries, expected_entries, path, initiatorType) {
|
||||
const url = window.location.protocol + "//" + window.location.host + path;
|
||||
|
||||
if (entries.find(function(entry) { return entry.name === url; })) {
|
||||
expected_entries[path] = initiatorType;
|
||||
}
|
||||
}
|
||||
|
||||
window.on_test_body_created = check_finished;
|
||||
window.on_async_xhr_done = function() {
|
||||
xhr_loaded = true;
|
||||
|
@ -110,5 +159,6 @@ window.on_async_xhr_done = function() {
|
|||
<p>This test validates that all of the initiator types are represented.</p>
|
||||
<div id="log"></div>
|
||||
<iframe id="frameContext" onload="onload_test();" src="resources/all_resource_types.htm" style="width: 250px; height: 250px;"></iframe>
|
||||
<iframe id="frameContext2" onload="frameset_onload();" src="resources/green_frame.htm" style="width: 250px; height: 250px;"></iframe>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
||||
<title>All Resource Types Test Page</title>
|
||||
<link rel="shortcut icon" href="empty.py?favicon">
|
||||
</head>
|
||||
<body background='blue.png?id=body'>
|
||||
<script>
|
||||
|
@ -10,7 +11,14 @@
|
|||
window.parent.on_test_body_created();
|
||||
</script>
|
||||
<link rel="stylesheet" href="nested.css"></link>
|
||||
<link rel="prefetch" href="nested.css?id=prefetch"></link>
|
||||
<link rel="preload" href="nested.css?id=preload" as="style"></link>
|
||||
<link rel="prerender" href="blank_page_green.htm?id=prerender"></link>
|
||||
<link rel="manifest" href="manifest.json"></link>
|
||||
<img src="resource_timing_test0.png"></img>
|
||||
<img src="resource_timing_test0.png?id=srcset-src"
|
||||
srcset="resource_timing_test0.png?id=srcset-srcset 67w"
|
||||
sizes="67px"></img>
|
||||
<iframe src="blank_page_green.htm" width="100px" height="100px"></iframe>
|
||||
<script src="empty_script.js"></script>
|
||||
<script>
|
||||
|
@ -21,6 +29,18 @@
|
|||
parent.on_async_xhr_done();
|
||||
}
|
||||
async_xhr.send();
|
||||
|
||||
if (window.navigator && navigator.sendBeacon) {
|
||||
navigator.sendBeacon('empty.py?id=beacon');
|
||||
}
|
||||
|
||||
if (window.fetch) {
|
||||
fetch('empty.py?id=fetch');
|
||||
}
|
||||
|
||||
if (window.EventSource) {
|
||||
var evtSource = new EventSource('eventsource.py?id=eventsource');
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
@font-face {
|
||||
|
@ -30,6 +50,9 @@
|
|||
iframe {
|
||||
background: url('blue.png?id=1');
|
||||
}
|
||||
body {
|
||||
cursor: url('blue.png?id=cursor'), pointer;
|
||||
}
|
||||
ul {
|
||||
font-family: remoteFontAhem;
|
||||
list-style-image: url('blue.png?id=2');
|
||||
|
@ -44,6 +67,41 @@
|
|||
<embed src="resource_timing_test0.css?id=embed" type="text/css"></embed>
|
||||
<input type="image" src="blue.png?id=input"></input>
|
||||
<object type="image/png" data="blue.png?id=object"></object>
|
||||
<video poster="blue.png?id=poster"></video>
|
||||
<video poster="blue.png?id=video-poster"></video>
|
||||
<video src="/media/test.mp4?id=video-src" autoplay="true"></video>
|
||||
<video autoplay="true">
|
||||
<source src="/media/test.mp4?id=video-source" type="video/mp4">
|
||||
<source src="/media/test.ogv?id=video-source" type="video/ogg">
|
||||
<track kind="subtitles" src="empty.py?id=video-track" srclang="en" default>
|
||||
</video>
|
||||
<audio src="empty.py?id=audio-src"></audio>
|
||||
<audio>
|
||||
<source src="empty.py?id=audio-source-wav" type="audio/wav" />
|
||||
<source src="empty.py?id=audio-source-mpeg" type="audio/mpeg" />
|
||||
<source src="empty.py?id=audio-source-ogg" type="audio/ogg" />
|
||||
</audio>
|
||||
<svg width=200 height=200
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<image href="blue.png?id=svg-image" height="200" width="200"/>
|
||||
</svg>
|
||||
<picture>
|
||||
<source srcset="blue.png?id=picture-source" type="image/png" />
|
||||
<img src="blue.png?id=picture-img" />
|
||||
</picture>
|
||||
<picture>
|
||||
<source srcset="blue.png?id=picture-notsupported-source" type="image/notsupported" />
|
||||
<img src="blue.png?id=picture-notsupported-img" />
|
||||
</picture>
|
||||
<picture>
|
||||
<img src="blue.png?id=picture-img-src"
|
||||
srcset="blue.png?id=picture-img-srcset"
|
||||
sizes="67px"></img>
|
||||
</picture>
|
||||
<picture>
|
||||
<img src="blue.png?id=picture-99x-img-src"
|
||||
srcset="blue.png?id=picture-99x-img-srcset 99x"
|
||||
sizes="67px"></img>
|
||||
</picture>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
def main(request, response):
|
||||
response.headers.set("Content-Type", "text/plain")
|
||||
return ""
|
|
@ -0,0 +1,3 @@
|
|||
def main(request, response):
|
||||
response.headers.set("Content-Type", "text/event-stream")
|
||||
return ""
|
|
@ -1,7 +1,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<frameset>
|
||||
<frame src="blank_page_green.htm">
|
||||
<frame src="blank_page_green.htm?id=frame">
|
||||
</frameset>
|
||||
</head>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue