Index: ppapi/native_client/tests/ppapi_browser/ppb_var/ppapi_ppb_var.html |
=================================================================== |
--- ppapi/native_client/tests/ppapi_browser/ppb_var/ppapi_ppb_var.html (revision 0) |
+++ ppapi/native_client/tests/ppapi_browser/ppb_var/ppapi_ppb_var.html (revision 0) |
@@ -0,0 +1,70 @@ |
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
+<html> |
+ <!-- Copyright 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. |
+ function expectMessages(test, plugin, messages) { |
+ test.assert(messages.length > 0, 'Must provide at least one message'); |
+ var listener = test.wrap(function(message) { |
+ console.log('got a message' + message.data); |
+ 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); |
+ console.log('adding' + test_name); |
+ tester.addAsyncTest('PPB_Var::' + test_name, function(test) { |
+ expectMessages(test, plugin, expected_messages); |
+ plugin.postMessage(test_name) |
+ }); |
+ } |
+ |
+ addTest('TestStringVarCreateDelete'); |
+ /* TestStringVarRefCount is flaky (or the implementation is flaky) |
+ Disabling for now. |
+ http://code.google.com/p/nativeclient/issues/detail?id=2124 |
+ TODO(sehr): file bug in chromium against pepper (and maybe fix it!) |
+ */ |
+ //addTest('TestStringVarRefCount'); |
+ } |
+ //]]> |
+ </script> |
+ <title>PPAPI PPB_Var Test</title> |
+ </head> |
+ <body> |
+ <h1>PPAPI PPB_Core Test</h1> |
+ |
+ <embed type="application/x-nacl" id="test_nexe" |
+ name="nacl_module" |
+ src="ppapi_ppb_var.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> |