mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-25 16:47:29 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
3
dom/speakermanager/tests/mochitest.ini
Normal file
3
dom/speakermanager/tests/mochitest.ini
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[DEFAULT]
|
||||
|
||||
[test_speakermanager.html]
|
||||
53
dom/speakermanager/tests/test_speakermanager.html
Normal file
53
dom/speakermanager/tests/test_speakermanager.html
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test MozSpeakerManager API</title>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
"use strict";
|
||||
|
||||
function testObject() {
|
||||
var mgr = new MozSpeakerManager();
|
||||
var spkforced = false;
|
||||
mgr.onspeakerforcedchange = function() {
|
||||
if (spkforced) {
|
||||
is(mgr.speakerforced, true, 'speaker should be true');
|
||||
spkforced = false;
|
||||
mgr.forcespeaker = false;
|
||||
} else {
|
||||
is(mgr.speakerforced, false, 'speaker should be false');
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
spkforced = true;
|
||||
mgr.forcespeaker = true;
|
||||
}
|
||||
|
||||
function startTests() {
|
||||
// Currently applicable only on FxOS
|
||||
if (navigator.userAgent.indexOf("Mobile") != -1 &&
|
||||
navigator.appVersion.indexOf("Android") == -1) {
|
||||
testObject();
|
||||
} else {
|
||||
ok(true, "MozSpeakerManager on Firefox OS only.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPermissions(
|
||||
[{ "type": "speaker-control", "allow": 1, "context": document }],
|
||||
startTests);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue