Update web-platform-tests to revision a46616a5b18e83587ddbbed756c7b96cbb4b015d

This commit is contained in:
Josh Matthews 2017-06-19 19:07:14 -04:00 committed by Ms2ger
parent 3f07cfec7c
commit 578498ba24
4001 changed files with 159517 additions and 30260 deletions

View file

@ -1,10 +0,0 @@
<!doctype html>
<meta charset=utf-8>
<title>NavigatorID</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src=NavigatorID.js></script>
<div id="log"></div>
<script>
run_test();
</script>

View file

@ -1,4 +0,0 @@
importScripts("/resources/testharness.js")
importScripts("NavigatorID.js")
run_test();
done();

View file

@ -0,0 +1,55 @@
<!doctype html>
<html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type="text/javascript">
test(function () {
for (var i = 0; i < navigator.plugins.length; i++) {
var plugin = navigator.plugins[i];
var name = plugin.name;
assert_equals(plugin, navigator.plugins[i]);
assert_equals(plugin, navigator.plugins[name]);
}
for (var i = 0; i < navigator.mimeTypes.length; i++) {
var mime_type = navigator.mimeTypes[i];
var type = mime_type.type;
assert_equals(mime_type, navigator.mimeTypes[i]);
assert_equals(mime_type, navigator.mimeTypes[type]);
assert_equals(mime_type.enabledPlugin, navigator.plugins[mime_type.enabledPlugin.name]);
}
}, "Tests that navigator.plugins and navigator.mimeTypes returns the same object when queried multiple times.");
test(function () {
var iframe = document.createElement("iframe");
iframe.src = "about:blank";
document.body.appendChild(iframe);
assert_equals(navigator.plugins.length, iframe.contentWindow.navigator.plugins.length);
assert_equals(navigator.mimeTypes.length, iframe.contentWindow.navigator.mimeTypes.length);
for (var i = 0; i < navigator.plugins.length; i++) {
var plugin = navigator.plugins[i];
var name = plugin.name;
assert_not_equals(plugin, iframe.contentWindow.navigator.plugins[i]);
assert_not_equals(plugin, iframe.contentWindow.navigator.plugins[name]);
}
for (var i = 0; i < navigator.mimeTypes.length; i++) {
var mime_type = navigator.mimeTypes[i];
var type = mime_type.type;
assert_not_equals(mime_type, iframe.contentWindow.navigator.mimeTypes[i]);
assert_not_equals(mime_type, iframe.contentWindow.navigator.mimeTypes[type]);
assert_not_equals(mime_type.enabledPlugin, iframe.contentWindow.navigator.plugins[mime_type.enabledPlugin.name]);
}
iframe.remove();
}, "Tests that navigator.plugins and navigator.mimeTypes does not return the same object on different frames.");
test(function () {
for (var i = 1; i < navigator.plugins.length; i++) {
assert_less_than_equal(navigator.plugins[i-1].name.localeCompare(navigator.plugins[i].name), 0);
}
for (var i = 1; i < navigator.mimeTypes.length; i++) {
assert_less_than_equal(navigator.mimeTypes[i-1].type.localeCompare(navigator.mimeTypes[i].type), 0);
}
}, "Tests that navigator.plugins and navigator.mimeTypes returns plugins sorted in alphabetical order by plugin name.");
</script>
</body>
</html>

View file

@ -1,4 +1,3 @@
function run_test() {
var compatibilityMode;
if (navigator.userAgent.includes("Chrome")) {
compatibilityMode = "Chrome";
@ -50,7 +49,7 @@ function run_test() {
async_test(function() {
var request = new XMLHttpRequest();
request.onload = this.step_func_done(function() {
assert_equals("user-agent: " + navigator.userAgent + "\n",
assert_equals("User-Agent: " + navigator.userAgent + "\n",
request.response,
"userAgent should return the value sent in the " +
"User-Agent header");
@ -103,4 +102,5 @@ function run_test() {
assert_false("oscpu" in navigator);
}
}, "oscpu");
}
done()