-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/w3c/web-platform-tests
- Loading branch information
Showing
595 changed files
with
12,371 additions
and
3,342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<!DOCTYPE html> | ||
<meta charset=utf-8> | ||
<title>createImageBitmap: origin-clean flag</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/media.js"></script> | ||
<script src="/common/namespaces.js"></script> | ||
<div id=log></div> | ||
<script> | ||
const crossOriginImageUrl = "http://{{domains[www1]}}:{{ports[http][0]}}/images/red.png"; | ||
|
||
function assert_origin_unclean(bitmap) { | ||
const context = document.createElement("canvas").getContext("2d"); | ||
context.drawImage(bitmap, 0, 0); | ||
assert_throws("SecurityError", () => { | ||
context.getImageData(0, 0, 1, 1); | ||
}); | ||
} | ||
|
||
function makeImage() { | ||
return new Promise((resolve, reject) => { | ||
const image = new Image(); | ||
image.onload = () => resolve(image); | ||
image.onerror = reject; | ||
image.src = crossOriginImageUrl; | ||
}); | ||
} | ||
|
||
const arguments = [ | ||
{ | ||
name: "cross-origin HTMLImageElement", | ||
factory: makeImage, | ||
}, | ||
|
||
{ | ||
name: "cross-origin SVGImageElement", | ||
factory: () => { | ||
return new Promise((resolve, reject) => { | ||
const image = document.createElementNS(NAMESPACES.svg, "image"); | ||
image.onload = () => resolve(image); | ||
image.onerror = reject; | ||
image.setAttribute("externalResourcesRequired", "true"); | ||
image.setAttributeNS(NAMESPACES.xlink, 'xlink:href', crossOriginImageUrl); | ||
document.body.appendChild(image); | ||
}); | ||
}, | ||
}, | ||
|
||
{ | ||
name: "cross-origin HTMLVideoElement", | ||
factory: () => { | ||
return new Promise((resolve, reject) => { | ||
const video = document.createElement("video"); | ||
video.oncanplaythrough = () => resolve(video); | ||
video.onerror = reject; | ||
video.src = getVideoURI("http://{{domains[www1]}}:{{ports[http][0]}}/media/movie_300"); | ||
}); | ||
}, | ||
}, | ||
|
||
{ | ||
name: "unclean HTMLCanvasElement", | ||
factory: () => { | ||
return makeImage().then(image => { | ||
const canvas = document.createElement("canvas"); | ||
const context = canvas.getContext("2d"); | ||
context.drawImage(image, 0, 0); | ||
return canvas; | ||
}); | ||
}, | ||
}, | ||
|
||
{ | ||
name: "unclean ImageBitmap", | ||
factory: () => { | ||
return makeImage().then(createImageBitmap); | ||
}, | ||
}, | ||
]; | ||
|
||
for (let { name, factory } of arguments) { | ||
promise_test(function() { | ||
return factory().then(createImageBitmap).then(assert_origin_unclean); | ||
}, name); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!doctype html> | ||
<title>Acid3 numbered tests</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
var tests = undefined; | ||
|
||
function gotMessage(e) { | ||
var m = e.data; | ||
if (tests === undefined && "num_tests" in m) { | ||
tests = []; | ||
for (var i = 0; i < m.num_tests; i++) { | ||
tests.push(async_test("Test " + i)); | ||
} | ||
} else if ("result" in m) { | ||
var test = m.test; | ||
var passed = m.result === "pass"; | ||
var message = m.message; | ||
tests[test].step(function() { | ||
assert_true(passed, message); | ||
}); | ||
tests[test].done(); | ||
} | ||
} | ||
window.addEventListener("message", gotMessage, false); | ||
</script> | ||
<iframe src="test.html"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
bluetooth/requestDevice/blocklisted-service-in-filter.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script src="/bluetooth/resources/bluetooth-helpers.js"></script> | ||
<script> | ||
'use strict'; | ||
const test_desc = 'Reject with SecurityError if requesting a blocklisted ' + | ||
'service.'; | ||
const expected = new DOMException( | ||
'requestDevice() called with a filter containing a blocklisted UUID. ' + | ||
'https://goo.gl/4NeimX', | ||
'SecurityError'); | ||
|
||
bluetooth_test(() => setUpPreconnectedDevice({ | ||
knownServiceUUIDs: ['human_interface_device'] | ||
}) | ||
.then(() => assert_promise_rejects_with_message( | ||
requestDeviceWithTrustedClick({ | ||
filters: [{services: ['human_interface_device']}] | ||
}), | ||
expected, 'Requesting blocklisted service rejects.')), | ||
test_desc); | ||
</script> |
Oops, something went wrong.