mirror of
https://github.com/servo/servo.git
synced 2025-08-26 07:38:21 +01:00
Update web-platform-tests to revision 9d009fc59a8f99e0117b841b7f49094cc690964c
This commit is contained in:
parent
42701e5588
commit
75857a918c
33 changed files with 645 additions and 127 deletions
|
@ -14,7 +14,7 @@ window.testIsPerWindow = propertyName => {
|
|||
iframe.remove();
|
||||
|
||||
const after = frame[propertyName];
|
||||
assert_equals(after, before);
|
||||
assert_equals(after, before, `window.${propertyName} should not change after iframe.remove()`);
|
||||
}, `Discarding the browsing context must not change window.${propertyName}`);
|
||||
|
||||
async_test(t => {
|
||||
|
@ -56,6 +56,8 @@ window.testIsPerWindow = propertyName => {
|
|||
|
||||
const after = frame[propertyName];
|
||||
assert_not_equals(after, before);
|
||||
|
||||
frame.document.close();
|
||||
});
|
||||
|
||||
iframe.src = "/common/blank.html";
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
contain: paint;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background: green;
|
||||
background: blue;
|
||||
margin: 25px;
|
||||
padding: 25px;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Reftest Reference</title>
|
||||
<link rel="author" title="Yusuf Sermet" href="mailto:ysermet@mozilla.com">
|
||||
<link rel="author" title="Kyle Zentner" href="mailto:zentner.kyle@gmail.com">
|
||||
<style>
|
||||
body {
|
||||
|
@ -14,7 +15,8 @@
|
|||
height: 100px;
|
||||
background: green;
|
||||
margin: 25px;
|
||||
padding: 25px;
|
||||
padding: 10px;
|
||||
border-radius: 4em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test: 'contain: paint' with overflowing text contents.</title>
|
||||
<title>CSS Test: 'contain: paint' with overflowing text contents inside a rounded rectangle box.</title>
|
||||
<link rel="author" title="Yusuf Sermet" href="mailto:ysermet@mozilla.com">
|
||||
<link rel="author" title="Kyle Zentner" href="mailto:zentner.kyle@gmail.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-containment-1/#containment-paint">
|
||||
<link rel="match" href="contain-paint-clip-002-ref.html">
|
||||
|
@ -16,7 +17,8 @@
|
|||
height: 100px;
|
||||
background: green;
|
||||
margin: 25px;
|
||||
padding: 25px;
|
||||
padding: 10px;
|
||||
border-radius: 4em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Reftest Reference</title>
|
||||
<link rel="author" title="Yusuf Sermet" href="mailto:ysermet@mozilla.com">
|
||||
<link rel="author" title="Kyle Zentner" href="mailto:zentner.kyle@gmail.com">
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
.root {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background: green;
|
||||
margin: 25px;
|
||||
padding: 25px;
|
||||
overflow: hidden;
|
||||
overflow-clip-box: content-box;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="root">
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA This text should
|
||||
be clipped to the content box. Lorem ipsum dolor sit amet, consectetur adipiscing
|
||||
elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed
|
||||
nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum.
|
||||
Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa.
|
||||
Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora
|
||||
torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales
|
||||
ligula in libero.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test: 'contain: paint' with overflowing text contents while "overflow-clip-box: content-box" enabled.</title>
|
||||
<link rel="author" title="Yusuf Sermet" href="mailto:ysermet@mozilla.com">
|
||||
<link rel="author" title="Kyle Zentner" href="mailto:zentner.kyle@gmail.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-containment-1/#containment-paint">
|
||||
<link rel="match" href="contain-paint-clip-006-ref.html">
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
.root {
|
||||
contain: paint;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background: green;
|
||||
margin: 25px;
|
||||
padding: 25px;
|
||||
overflow-clip-box: content-box;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="root">
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA This text should
|
||||
be clipped to the content box. Lorem ipsum dolor sit amet, consectetur adipiscing
|
||||
elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed
|
||||
nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum.
|
||||
Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa.
|
||||
Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora
|
||||
torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales
|
||||
ligula in libero.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -4,6 +4,7 @@
|
|||
== contain-paint-clip-003.html contain-paint-clip-003-ref.html
|
||||
== contain-paint-clip-004.html contain-paint-clip-004-ref.html
|
||||
== contain-paint-clip-005.html contain-paint-clip-003-ref.html
|
||||
== contain-paint-clip-006.html contain-paint-clip-006-ref.html
|
||||
== contain-paint-containing-block-absolute-001.html contain-paint-containing-block-absolute-001-ref.html
|
||||
== contain-paint-containing-block-fixed-001.html contain-paint-containing-block-fixed-001-ref.html
|
||||
== contain-paint-formatting-context-float-001.html contain-paint-formatting-context-float-001-ref.html
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE HTML>
|
||||
<meta charset="utf-8">
|
||||
<title>Retry inline floats until they fit -- circle</title>
|
||||
<link rel="author" title="Brad Werth" href="mailto:bwerth@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-shapes-1/">
|
||||
<link rel="match" href="float-retry-push-ref.html">
|
||||
<meta name="flags" content="">
|
||||
<meta name="assert" content="Test that a too-wide inline block is pushed in the block direction along a shape-outside circle until it fits.">
|
||||
<style>
|
||||
body {
|
||||
margin: 0px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
#too-wide {
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
width: 250px;
|
||||
background: blue;
|
||||
}
|
||||
|
||||
#shape {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
float: left;
|
||||
shape-outside: circle(70.710678px at 0px 0px);
|
||||
/* 70.710678 = 50 / (sqrt(2) / 2) */
|
||||
}
|
||||
</style>
|
||||
|
||||
<div style="width: 300px; height: 100px;">
|
||||
<div id="shape"></div>
|
||||
<span id="too-wide"></span>
|
||||
<div>
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE HTML>
|
||||
<meta charset="utf-8">
|
||||
<title>Retry inline floats until they fit -- image</title>
|
||||
<link rel="author" title="Brad Werth" href="mailto:bwerth@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-shapes-1/">
|
||||
<link rel="match" href="float-retry-push-ref.html">
|
||||
<meta name="flags" content="">
|
||||
<meta name="assert" content="Test that a too-wide inline block is pushed in the block direction along a shape-outside image until it fits.">
|
||||
<style>
|
||||
body {
|
||||
margin: 0px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
#too-wide {
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
width: 250px;
|
||||
background: blue;
|
||||
}
|
||||
|
||||
#shape {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
float: left;
|
||||
shape-outside: linear-gradient(135deg, black, black 50%, transparent 50%);
|
||||
}
|
||||
</style>
|
||||
|
||||
<div style="width: 300px; height: 100px;">
|
||||
<div id="shape"></div>
|
||||
<span id="too-wide"></span>
|
||||
<div>
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE HTML>
|
||||
<meta charset="utf-8">
|
||||
<title>Retry inline floats until they fit -- inset</title>
|
||||
<link rel="author" title="Brad Werth" href="mailto:bwerth@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-shapes-1/">
|
||||
<link rel="match" href="float-retry-push-ref.html">
|
||||
<meta name="flags" content="">
|
||||
<meta name="assert" content="Test that a too-wide inline block is pushed in the block direction along a shape-outside inset until it fits.">
|
||||
<style>
|
||||
body {
|
||||
margin: 0px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
#too-wide {
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
width: 250px;
|
||||
background: blue;
|
||||
}
|
||||
|
||||
#shape {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
float: left;
|
||||
shape-outside: inset(0px 40px 40px 0px round 0 0 34.142136px 0);
|
||||
/* 34.142136 = 10 / (1 - (sqrt(2) / 2)) */
|
||||
}
|
||||
</style>
|
||||
|
||||
<div style="width: 300px; height: 100px;">
|
||||
<div id="shape"></div>
|
||||
<span id="too-wide"></span>
|
||||
<div>
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE HTML>
|
||||
<meta charset="utf-8">
|
||||
<title>Retry inline floats until they fit -- polygon</title>
|
||||
<link rel="author" title="Brad Werth" href="mailto:bwerth@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-shapes-1/">
|
||||
<link rel="match" href="float-retry-push-ref.html">
|
||||
<meta name="flags" content="">
|
||||
<meta name="assert" content="Test that a too-wide inline block is pushed in the block direction along a shape-outside polygon until it fits.">
|
||||
<style>
|
||||
body {
|
||||
margin: 0px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
#too-wide {
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
width: 250px;
|
||||
background: blue;
|
||||
}
|
||||
|
||||
#shape {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
float: left;
|
||||
shape-outside: polygon(0px 0px, 100px 0px, 0px 100px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<div style="width: 300px; height: 100px;">
|
||||
<div id="shape"></div>
|
||||
<span id="too-wide"></span>
|
||||
<div>
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE HTML>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for retrying floats and pushing them partway down the float area</title>
|
||||
<link rel="author" title="Brad Werth" href="mailto:bwerth@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<style>
|
||||
body {
|
||||
margin: 0px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
#too-wide {
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
width: 250px;
|
||||
background: blue;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div style="width: 300px; height: 100px">
|
||||
<span id="too-wide" style="margin-top: 50px; margin-left: 50px;"></span>
|
||||
</div>
|
|
@ -103,3 +103,9 @@
|
|||
== shape-outside-polygon-024.html shape-outside-polygon-024-ref.html
|
||||
== shape-outside-polygon-025.html shape-outside-polygon-025-ref.html
|
||||
== shape-outside-polygon-032.html shape-outside-polygon-032-ref.html
|
||||
|
||||
# Tests of shape-outside layout behavior with too-wide inline elements
|
||||
== float-retry-push-circle.html float-retry-push-ref.html
|
||||
== float-retry-push-image.html float-retry-push-ref.html
|
||||
== float-retry-push-inset.html float-retry-push-ref.html
|
||||
== float-retry-push-polygon.html float-retry-push-ref.html
|
||||
|
|
9
tests/wpt/web-platform-tests/interfaces/webdriver.idl
Normal file
9
tests/wpt/web-platform-tests/interfaces/webdriver.idl
Normal file
|
@ -0,0 +1,9 @@
|
|||
// GENERATED CONTENT - DO NOT EDIT
|
||||
// Content of this file was automatically extracted from the
|
||||
// "WebDriver" spec.
|
||||
// See: https://w3c.github.io/webdriver/webdriver-spec.html
|
||||
|
||||
Navigator includes NavigatorAutomationInformation;
|
||||
interface mixin NavigatorAutomationInformation {
|
||||
readonly attribute boolean webdriver;
|
||||
};
|
|
@ -1,7 +1,7 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Keyboard IDL tests</title>
|
||||
<title>Keyboard Lock IDL tests</title>
|
||||
<link rel="help" href="https://w3c.github.io/keyboard-lock/"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
|
|
@ -4,6 +4,22 @@
|
|||
<script>
|
||||
'use strict';
|
||||
|
||||
test(function() {
|
||||
assert_true(navigator.keyboard instanceof Keyboard);
|
||||
}, "navigator.keyboard instanceof Keyboard");
|
||||
|
||||
test(function() {
|
||||
assert_equals(navigator.keyboard, navigator.keyboard);
|
||||
}, "navigator.keyboard SameObject");
|
||||
|
||||
test(function() {
|
||||
assert_true(navigator.keyboard.lock instanceof Function);
|
||||
}, "navigator.keyboard.lock instanceof Function");
|
||||
|
||||
test(function() {
|
||||
assert_true(navigator.keyboard.unlock instanceof Function);
|
||||
}, "navigator.keyboard.unlock instanceof Function");
|
||||
|
||||
promise_test(() => {
|
||||
const p = navigator.keyboard.lock(["KeyA", "KeyB"]);
|
||||
assert_true(p instanceof Promise);
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
promise_test((t) => {
|
||||
const p1 = navigator.keyboard.getLayoutMap();
|
||||
const p2 = navigator.keyboard.getLayoutMap();
|
||||
// p1 and p2 should be the same promise instance.
|
||||
assert_equals(p1, p2);
|
||||
return Promise.all([p1, p2]);
|
||||
}, '[Keyboard Map] getLayoutMap() twice in parallel');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/cors/support.js?pipe=sub"></script>
|
||||
<body>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
promise_test(() => {
|
||||
let iframe = document.createElement('iframe');
|
||||
iframe.src = CROSSDOMAIN + 'resources/iframe-keyboard-map-helper.html';
|
||||
iframe.onload = () => {
|
||||
iframe.contentWindow.postMessage('Ready', '*');
|
||||
}
|
||||
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
return new Promise((resolve,reject) => {
|
||||
window.onmessage = message => {
|
||||
if (message.data == 'Success') {
|
||||
resolve();
|
||||
} else if (message.data == 'Failure') {
|
||||
reject();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, '[Keyboard Map] getLayoutMap() blocked from within cross-origin iframe');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
promise_test(() => {
|
||||
let iframe = document.createElement('iframe');
|
||||
iframe.src = 'resources/iframe-keyboard-map-helper.html';
|
||||
iframe.onload = () => {
|
||||
iframe.contentWindow.postMessage('Ready', '*');
|
||||
}
|
||||
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
return new Promise((resolve,reject) => {
|
||||
window.onmessage = message => {
|
||||
if (message.data == 'Success') {
|
||||
resolve();
|
||||
} else if (message.data == 'Failure') {
|
||||
reject();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, '[Keyboard Map] getLayoutMap() blocked from within iframe');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
promise_test((t) => {
|
||||
const p1 = navigator.keyboard.getLayoutMap();
|
||||
const p2 = navigator.keyboard.getLayoutMap();
|
||||
// p1 and p2 should be the same promise instance.
|
||||
assert_equals(p1, p2);
|
||||
return Promise.all([p1, p2]);
|
||||
}, '[Keyboard Map] getLayoutMap() twice in parallel');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
promise_test(() => {
|
||||
return navigator.keyboard.getLayoutMap()
|
||||
.then(() => {
|
||||
return navigator.keyboard.getLayoutMap();
|
||||
});
|
||||
}, '[Keyboard Map] getLayoutMap() called twice sequentially');
|
||||
|
||||
</script>
|
|
@ -13,7 +13,11 @@ test(function() {
|
|||
assert_equals(navigator.keyboard, navigator.keyboard);
|
||||
}, "navigator.keyboard SameObject");
|
||||
|
||||
promise_test(function() {
|
||||
test(function() {
|
||||
assert_true(navigator.keyboard.getLayoutMap instanceof Function);
|
||||
}, "navigator.keyboard.getLayoutMap instanceof Function");
|
||||
|
||||
promise_test(() => {
|
||||
const p = navigator.keyboard.getLayoutMap();
|
||||
assert_true(p instanceof Promise);
|
||||
return p.then(function(map) {
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
window.onmessage = message => {
|
||||
if (message.data === 'Ready') {
|
||||
let onSuccess = () => { parent.postMessage('Failure', '*'); };
|
||||
let onError = error => {
|
||||
if (error.name == 'InvalidStateError') {
|
||||
parent.postMessage('Success', '*');
|
||||
} else {
|
||||
parent.postMessage('Failure', '*');
|
||||
}
|
||||
};
|
||||
|
||||
navigator.keyboard.getLayoutMap().then(onSuccess, onError);
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
|
@ -0,0 +1,23 @@
|
|||
// META: script=/resources/WebIDLParser.js
|
||||
// META: script=/resources/idlharness.js
|
||||
|
||||
// https://wicg.github.io/media-capabilities/
|
||||
|
||||
'use strict';
|
||||
|
||||
promise_test(async () => {
|
||||
const idl = await fetch('/interfaces/media-capabilities.idl').then(r => r.text());
|
||||
const html = await fetch('/interfaces/html.idl').then(r => r.text());
|
||||
const cssomView = await fetch('/interfaces/cssom-view.idl').then(r => r.text());
|
||||
|
||||
var idl_array = new IdlArray();
|
||||
idl_array.add_idls(idl);
|
||||
idl_array.add_dependency_idls(html);
|
||||
idl_array.add_dependency_idls(cssomView);
|
||||
|
||||
idl_array.add_objects({
|
||||
Navigator: ['navigator']
|
||||
});
|
||||
|
||||
idl_array.test();
|
||||
}, 'Test IDL implementation of Media Capabilities');
|
|
@ -1,37 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Media Capabilities IDL tests</title>
|
||||
<link rel="help" href="https://wicg.github.io/media-capabilities/"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/WebIDLParser.js"></script>
|
||||
<script src="/resources/idlharness.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Media Session IDL tests</h1>
|
||||
<script>
|
||||
"use strict";
|
||||
function doTest([media_capabilities]) {
|
||||
var idl_array = new IdlArray();
|
||||
idl_array.add_untested_idls('interface Navigator {};');
|
||||
idl_array.add_untested_idls('interface WorkerNavigator {};');
|
||||
idl_array.add_untested_idls('interface Screen {};');
|
||||
idl_array.add_idls(media_capabilities);
|
||||
idl_array.add_objects({
|
||||
Navigator: ["navigator"]
|
||||
});
|
||||
idl_array.test();
|
||||
}
|
||||
function fetchText(url) {
|
||||
return fetch(url).then((response) => response.text());
|
||||
}
|
||||
promise_test(() => {
|
||||
return Promise.all(["/interfaces/media-capabilities.idl"].map(fetchText))
|
||||
.then(doTest);
|
||||
}, "Test IDL implementation of Media Capabilities");
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
</body>
|
||||
</html>
|
|
@ -12,27 +12,20 @@
|
|||
<body>
|
||||
<h1>Media Session IDL tests</h1>
|
||||
<script>
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
function doTest([mediasession]) {
|
||||
var idl_array = new IdlArray();
|
||||
idl_array.add_untested_idls('interface Navigator {};');
|
||||
idl_array.add_idls(mediasession);
|
||||
idl_array.add_objects({
|
||||
MediaMetadata: ["new MediaMetadata()"],
|
||||
Navigator: ["navigator"]
|
||||
});
|
||||
idl_array.test();
|
||||
}
|
||||
|
||||
function fetchText(url) {
|
||||
return fetch(url).then((response) => response.text());
|
||||
}
|
||||
|
||||
promise_test(() => {
|
||||
return Promise.all(["/interfaces/mediasession.idl"].map(fetchText))
|
||||
.then(doTest);
|
||||
}, "Test IDL implementation of Media Session");
|
||||
promise_test(async () => {
|
||||
var idl_array = new IdlArray();
|
||||
const idl = await fetch('/interfaces/mediasession.idl').then(r => r.text());
|
||||
const html = await fetch('/interfaces/html.idl').then(r => r.text());
|
||||
idl_array.add_idls(idl);
|
||||
idl_array.add_dependency_idls(html);
|
||||
idl_array.add_objects({
|
||||
MediaMetadata: ['new MediaMetadata()'],
|
||||
Navigator: ['navigator']
|
||||
});
|
||||
idl_array.test();
|
||||
}, 'Test IDL implementation of Media Session');
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
</body>
|
||||
|
|
|
@ -1,49 +1,23 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
|
||||
<link rel="help" href="https://w3c.github.io/webdriver/">
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=/resources/WebIDLParser.js></script>
|
||||
<script src=/resources/idlharness.js></script>
|
||||
|
||||
<script type=text/plain class=untested>
|
||||
[Exposed=Window]
|
||||
interface Navigator {
|
||||
// objects implementing this interface also implement the interfaces given below
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type=text/plain>
|
||||
Navigator includes NavigatorAutomationInformation;
|
||||
|
||||
interface mixin NavigatorAutomationInformation {
|
||||
readonly attribute boolean webdriver;
|
||||
};
|
||||
</script>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
test(() => assert_idl_attribute(navigator, "webdriver"), "navigator.webdriver is present");
|
||||
|
||||
// When test is run in automation navigator.webdriver is likely to
|
||||
// be true because WebDriver controls the browser instance. To that
|
||||
// extent, this test is a bit special. It should also be possible to
|
||||
// run the test manually, when WebDriver is not active, and so either
|
||||
// true/false outcome is OK.
|
||||
if (navigator.webdriver) {
|
||||
test(() => assert_true(navigator.webdriver), "navigator.webdriver is true when webdriver-active is set");
|
||||
} else {
|
||||
test(() => assert_false(navigator.webdriver), "navigator.webdriver is false when webdriver-active is not set");
|
||||
}
|
||||
|
||||
var idls = new IdlArray();
|
||||
for (let node of [...document.scripts].filter(({type}) => type == "text/plain")) {
|
||||
if (node.className == "untested") {
|
||||
idls.add_untested_idls(node.textContent);
|
||||
} else {
|
||||
idls.add_idls(node.textContent);
|
||||
}
|
||||
};
|
||||
idls.test();
|
||||
promise_test(async () => {
|
||||
const idl_array = new IdlArray();
|
||||
const idl = await fetch("/interfaces/webdriver.idl").then(r => r.text());
|
||||
const html = await fetch("/interfaces/html.idl").then(r => r.text());
|
||||
idl_array.add_idls(idl);
|
||||
idl_array.add_dependency_idls(html);
|
||||
idl_array.add_objects({
|
||||
Navigator: ["navigator"]
|
||||
});
|
||||
idl_array.test();
|
||||
}, "Test IDL implementation of webdriver API");
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue