Files
palemoon27/dom/requestsync/tests/test_webidl.html
T
roytam1 10f5941b9c import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1246051 - have MediaQueue<T>::Peek/PeekFront return a RefPtr<> to avoid dangling pointers per comment 0. r=gerald. (00f334efb1)
- Bug 1264199: P1. Perform audio conversion in the MSDM taskqueue and ahead of use. r=kinetik (001936e3ea)
- Bug 1267983 - include MediaQueue.h; r=jwwang (036107d765)
- Bug 1264199: P0. Fix nsDequeue/MediaQueue methods constness. r=jwwang (9aa33dfcb5)
- Bug 1264199: P0.1. Export SaferMultDiv method. r=gerald (0b7a35ae4d)
- Bug 1264199: P2. Ensure the AudioStream only ever receive the same content format. r=kinetik (a180d09279)
- Bug 1264199: P3. Attempt to minimize audio quality loss and unnecessary processing. r=kinetik (29d57b5a33)
- Bug 1264199: P4. Add mono to stereo upmix to AudioConverter. r=rillian (49c029bd86)
- Bug 1264199: P5. Perform all downmixing operations in DecodedAudioDataSink. r=kinetik (05a479f095)
- Bug 1264199: P6. Drain resampler when changing format or reaching the end. r=kinetik (8639102a94)
- Bug 1264199: P8. Handle potential resampling errors. r=kinetik (1267e4e73d)
- Bug 1264199: P9. Include pending frames in HasUnplayedFrames calculation. r=jwwang (ce7097fc90)
2024-08-28 23:32:14 +08:00

105 lines
3.0 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test for RequestSync interfaces</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script type="application/javascript;version=1.7">
function makeIframe() {
var iframe = document.createElement('iframe');
return document.body.appendChild(iframe);
}
function destroyIframe(iframe) {
iframe.remove();
}
function test_no_interface() {
var iframe = makeIframe();
ok(!("sync" in iframe.contentWindow.navigator), "navigator.sync should not exist without permissions");
ok(!("syncManager" in iframe.contentWindow.navigator), "navigator.syncManager should not exist without permissions");
destroyIframe(iframe);
runTests();
}
function test_sync(win) {
ok("register" in win.navigator.sync, "navigator.sync.register exists");
ok("unregister" in win.navigator.sync, "navigator.sync.unregister exists");
ok("registrations" in win.navigator.sync, "navigator.sync.registrations exists");
ok("registration" in win.navigator.sync, "navigator.sync.registration exists");
}
function test_sync_interface() {
var iframe = makeIframe();
ok("sync" in iframe.contentWindow.navigator, "navigator.sync should exist with permissions");
ok(!("syncManager" in iframe.contentWindow.navigator), "navigator.syncManager should not exist without permissions");
test_sync(iframe.contentWindow);
destroyIframe(iframe);
runTests();
}
function test_sync_manager_interface() {
var iframe = makeIframe();
ok("sync" in iframe.contentWindow.navigator, "navigator.sync should exist with permissions");
ok("syncManager" in iframe.contentWindow.navigator, "navigator.syncManager should exist with permissions");
test_sync(iframe.contentWindow);
ok("registrations" in iframe.contentWindow.navigator.syncManager, "navigator.syncManager.registrations exists");
destroyIframe(iframe);
runTests();
}
var tests = [
function() {
SpecialPowers.pushPrefEnv({"set": [["dom.requestSync.enabled", false]]}, runTests);
},
test_no_interface,
function() {
SpecialPowers.pushPrefEnv({"set": [["dom.ignore_webidl_scope_checks", true]]}, runTests);
},
test_no_interface,
function() {
SpecialPowers.pushPrefEnv({"set": [["dom.requestSync.enabled", true],
["dom.requestSync.minInterval", 1]]}, runTests);
},
test_sync_interface,
// Permissions
function() {
SpecialPowers.pushPermissions(
[{ "type": "requestsync-manager", "allow": 1, "context": document } ], runTests);
},
test_sync_manager_interface,
];
function runTests() {
if (!tests.length) {
finish();
return;
}
var test = tests.shift();
test();
}
function finish() {
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
runTests();
</script>
</body>
</html>