Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #33450 from evanxd/bug-1227825
Browse files Browse the repository at this point in the history
Bug 1227825 - Marionette tests for audio channels compete each other r=lchang
  • Loading branch information
evanxd committed Dec 16, 2015
2 parents 8faea23 + ddffdd3 commit e0a7a46
Show file tree
Hide file tree
Showing 6 changed files with 786 additions and 0 deletions.
Binary file not shown.
57 changes: 57 additions & 0 deletions apps/system/test/apps/audio_channel_test_app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Audio Channel Test App</title>
<style>
html, body {
width: 100%;
height: 100%;
overflow: hidden;
}
</style>
<script defer src="/js/index.js"></script>
</head>
<body>
<div id="normal">
<span>Normal</span>
<button class="play">Play</button>
<button class="pause">Pause</button>
<div/>
<div id="content">
<span>Content</span>
<button class="play">Play</button>
<button class="pause">Pause</button>
<div/>
<div id="alarm">
<span>Alarm</span>
<button class="play">Play</button>
<button class="pause">Pause</button>
<div/>
<div id="system">
<span>System</span>
<button class="play">Play</button>
<button class="pause">Pause</button>
<div/>
<div id="ringer">
<span>Ringer</span>
<button class="play">Play</button>
<button class="pause">Pause</button>
<div/>
<div id="telephony">
<span>Telephony</span>
<button class="play">Play</button>
<button class="pause">Pause</button>
<div/>
<div id="notification">
<span>Notification</span>
<button class="play">Play</button>
<button class="pause">Pause</button>
<div/>
<div id="publicnotification">
<span>Public Notification</span>
<button class="play">Play</button>
<button class="pause">Pause</button>
<div/>
</body>
</html>
21 changes: 21 additions & 0 deletions apps/system/test/apps/audio_channel_test_app/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';
(function() {
['normal', 'content', 'alarm', 'system', 'ringer',
'telephony', 'notification', 'publicnotification'].forEach(function(type){
var play = document.querySelector('#' + type + ' .play');
var pause = document.querySelector('#' + type + ' .pause');
var audio = new Audio();

audio.src = 'audio/b2g.ogg';
audio.loop = true;
audio.mozAudioChannelType = type;

play.addEventListener('click', function() {
audio.play();
});

pause.addEventListener('click', function() {
audio.pause();
});
});
}());
19 changes: 19 additions & 0 deletions apps/system/test/apps/audio_channel_test_app/manifest.webapp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Audio Channel Test App",
"type": "certified",
"description": "Audio Channel Test App",
"launch_path": "/index.html",
"developer": {
"name": "The Gaia Team",
"url": "https://github.com/mozilla-b2g/gaia"
},
"permissions": {
"audio-channel-content": {},
"audio-channel-alarm": {},
"audio-channel-system": {},
"audio-channel-ringer": {},
"audio-channel-telephony": {},
"audio-channel-notification": {},
"audio-channel-publicnotification": {}
}
}
Loading

0 comments on commit e0a7a46

Please sign in to comment.