Index: ppapi/native_client/tests/ppapi_example_audio/ppapi_example_audio.html |
=================================================================== |
--- ppapi/native_client/tests/ppapi_example_audio/ppapi_example_audio.html (revision 0) |
+++ ppapi/native_client/tests/ppapi_example_audio/ppapi_example_audio.html (revision 0) |
@@ -0,0 +1,71 @@ |
+<!-- |
+ Copyright 2011 The Native Client Authors. All rights reserved. |
+ Use of this source code is governed by a BSD-style license that can |
+ be found in the LICENSE file. |
+--> |
+ |
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
+<html> |
+ <head> |
+ <META HTTP-EQUIV="Pragma" CONTENT="no-cache" /> |
+ <META HTTP-EQUIV="Expires" CONTENT="-1" /> |
+ <script type="text/javascript" src="nacltest.js"></script> |
+ <title>PPAPI Audio</title> |
+ </head> |
+ |
+ <body> |
+ <h1>Native Client PPAPI Audio</h1> |
+ <div id="attach"></div> |
+ <br />Verify that a 400Hz tone is emitted on the left channel.<br /> |
+ <br />Verify that a 1000Hz tone is emitted on the right |
+ channel.<br /> |
+ <br />Note: This example depends on your system supporting audio |
+ output.<br /> |
+ |
+ <script type="text/javascript"> |
+ //<![CDATA[ |
+function setupTests(tester, plugin) { |
+ |
+ tester.addAsyncTest('TestPlayback', function(status) { |
+ // Register a message listener to receive test result. |
+ var messageListener = status.wrap(function(message) { |
+ status.log('Received message: ' + message.data); |
+ plugin.removeEventListener('message', messageListener, false); |
+ status.assertEqual(message.data, 'StopOutput:PASSED'); |
+ status.pass(); |
+ }); |
+ plugin.addEventListener("message", messageListener, false); |
+ |
+ // Tell the nexe to start playing audio. |
+ plugin.postMessage('StartPlayback'); |
+ }); |
+} |
+ |
+var playback; |
+if (location.hash == "#mute") { |
+ playback = 'amplitude_l="0" amplitude_r="0" duration_msec="1000"' + |
+ 'headless="1"'; |
+} else { |
+ playback = 'amplitude_l="1" amplitude_r="1" duration_msec="10000"'; |
+} |
+var node = document.createElement('div'); |
+node.innerHTML = '<embed id="naclModule" ' + |
+ 'name="naclModule" ' + |
+ 'width=0 height=0 ' + |
+ 'src="ppapi_example_audio.nmf" ' + |
+ 'basic_tests="1" ' + |
+ 'stress_tests="0" ' + |
+ 'style="background-color:gray" ' + |
+ 'type="application/x-nacl" ' + |
+ playback + ' />'; |
+document.getElementById('attach').appendChild(node); |
+ |
+var tester = new Tester(); |
+setupTests(tester, $('naclModule')); |
+tester.waitFor($('naclModule')); |
+tester.run(); |
+ //]]> |
+ </script> |
+ </body> |
+</html> |