Roll leveldb 3f7758:803d69 (v1.17 -> v1.18)
[chromium-blink-merge.git] / chrome / test / data / nacl / ppapi / ppb_instance / ppapi_ppb_instance.html
bloba848ec09efa85bd81584585a93fcf60f9321d64d
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html>
4 <!-- Copyright 2011 Google Inc. All rights reserved. -->
5 <head>
6 <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
7 <META HTTP-EQUIV="Expires" CONTENT="-1" />
8 <script type="text/javascript" src="nacltest.js"></script>
9 <script type="application/x-javascript">
10 //<![CDATA[
11 function setupTests(tester, plugin) {
12 // This function takes an array of messages and asserts that the nexe
13 // calls PostMessage with each of these messages, in order.
14 function expectMessages(test, plugin, messages) {
15 test.assert(messages.length > 0, 'Must provide at least one message');
16 var listener = test.wrap(function(message) {
17 plugin.removeEventListener('message', listener, false);
18 test.assertEqual(message.data, messages.shift());
19 if (messages.length == 0) {
20 test.pass();
21 } else {
22 plugin.addEventListener('message', listener, false);
24 });
25 plugin.addEventListener('message', listener, false);
28 function addTest(test_name, responses) {
29 if (responses === undefined) {
30 responses = [];
32 var expected_messages = [test_name + ':PASSED'].concat(responses);
33 tester.addAsyncTest('PPB_Instance::' + test_name, function(test) {
34 expectMessages(test, plugin, expected_messages);
35 plugin.postMessage(test_name)
36 });
39 addTest('TestIsFullFrame');
40 addTest('TestBindGraphics');
42 //]]>
43 </script>
44 <title>PPAPI PPB_Instance Test</title>
45 </head>
46 <body>
47 <h1>PPAPI PPB_Instance Test</h1>
49 <script type="text/javascript">
50 //<![CDATA[
51 function createModule(id, src, type) {
52 return createNaClEmbed({
53 id: id,
54 src: src,
55 width: 1,
56 height: 1,
57 type: type
58 });
61 var mime = 'application/x-nacl';
62 if (getTestArguments()['pnacl'] !== undefined) {
63 mime = 'application/x-pnacl';
65 var embed = createModule('test_nexe', 'ppapi_ppb_instance.nmf', mime);
66 document.body.appendChild(embed);
68 var tester = new Tester();
69 setupTests(tester, $('test_nexe'));
70 tester.waitFor($('test_nexe'));
71 tester.run();
72 //]]>
73 </script>
74 </body>
75 </html>