Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: ppapi/native_client/tests/ppapi_example_audio/ppapi_example_audio.html

Issue 7740013: Cloning a bunch of stuff from the native_client repository at r6528 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698