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

Unified Diff: ppapi/native_client/tests/ppapi_browser/ppb_memory/ppapi_ppb_memory.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_browser/ppb_memory/ppapi_ppb_memory.html
===================================================================
--- ppapi/native_client/tests/ppapi_browser/ppb_memory/ppapi_ppb_memory.html (revision 0)
+++ ppapi/native_client/tests/ppapi_browser/ppb_memory/ppapi_ppb_memory.html (revision 0)
@@ -0,0 +1,66 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <!-- Copyright (c) 2011 Google Inc. All rights reserved. -->
+ <head>
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="-1" />
+ <script type="text/javascript" src="nacltest.js"></script>
+ <script type="application/x-javascript">
+ //<![CDATA[
+ function setupTests(tester, plugin) {
+ // This function takes an array of messages and asserts that the nexe
+ // calls PostMessage with each of these messages, in order.
+ // TODO(dmichael, polina, ncbray or mball): This is copy/pasted from
+ // ppapi_ppb_instance.html, which was probably copy/pasted from
+ // somewhere else. We should move this or something like it to
+ // nacltest.js and remove this code from the tests that use it.
+ function expectMessages(test, plugin, messages) {
+ test.assert(messages.length > 0, 'Must provide at least one message');
+ var listener = test.wrap(function(message) {
+ plugin.removeEventListener('message', listener, false);
+ test.assertEqual(message.data, messages.shift());
+ if (messages.length == 0) {
+ test.pass();
+ } else {
+ plugin.addEventListener('message', listener, false);
+ }
+ });
+ plugin.addEventListener('message', listener, false);
+ }
+
+ function addTest(test_name, responses) {
+ if (responses === undefined) {
+ responses = [];
+ }
+ var expected_messages = [test_name + ':PASSED'].concat(responses);
+ tester.addAsyncTest('PPB_Instance::' + test_name, function(test) {
+ expectMessages(test, plugin, expected_messages);
+ plugin.postMessage(test_name)
+ });
+ }
+
+ addTest('TestMemAllocAndMemFree');
+ }
+ //]]>
+ </script>
+ <title>PPAPI PPB_Memory_Dev Test</title>
+ </head>
+ <body>
+ <h1>PPAPI PPB_Memory_Dev Test</h1>
+
+ <embed type="application/x-nacl" id="test_nexe"
+ name="nacl_module"
+ src="ppapi_ppb_memory.nmf"
+ width="0" height="0" />
+
+ <script type="text/javascript">
+ //<![CDATA[
+ var tester = new Tester();
+ setupTests(tester, $('test_nexe'));
+ tester.waitFor($('test_nexe'));
+ tester.run();
+ //]]>
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698