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

Unified Diff: ppapi/native_client/tests/ppapi_example_post_message/ppapi_example_post_message.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_post_message/ppapi_example_post_message.html
===================================================================
--- ppapi/native_client/tests/ppapi_example_post_message/ppapi_example_post_message.html (revision 0)
+++ ppapi/native_client/tests/ppapi_example_post_message/ppapi_example_post_message.html (revision 0)
@@ -0,0 +1,60 @@
+<!--
+ 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>Native Client PPAPI Post Message Example</title>
+ </head>
+
+ <body>
+ <h1>Native Client PPAPI Post Message Example</h1>
+ <div>
+ <embed id="naclModule"
+ name="naclModule"
+ width=400 height=400
+ src="ppapi_example_post_message.nmf"
+ basic_tests="2"
+ stress_tests="0"
+ style="background-color:gray"
+ type="application/x-nacl" />
+ </div>
+
+ <script type="text/javascript">
+ //<![CDATA[
+function setupTests(tester, plugin) {
+ tester.addAsyncTest('TestPalindrome', function(status) {
+ // Try posting a palindrome to the plugin.
+ plugin.addEventListener('message', function(message_event) {
+ this.removeEventListener('message', arguments.callee, false);
+ status.assertEqual(message_event.data, true);
+ status.pass();
+ }, false);
+ plugin.postMessage('amokigleredderelgikoma');
+ });
+
+ tester.addAsyncTest('TestNonPalindrome', function(status) {
+ // Try posting a non-palindrome.
+ plugin.addEventListener('message', function(message_event) {
+ this.removeEventListener('message', arguments.callee, false);
+ status.assertEqual(message_event.data, false);
+ status.pass();
+ }, false);
+ plugin.postMessage('This is not a palindrome.');
+ });
+}
+
+var tester = new Tester();
+setupTests(tester, $('naclModule'));
+tester.waitFor($('naclModule'));
+tester.run();
+ //]]>
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698