OLD | NEW |
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
3 <html> | 3 <html> |
4 <!-- Copyright 2011 Google Inc. All rights reserved. --> | 4 <!-- Copyright 2011 Google Inc. All rights reserved. --> |
5 <head> | 5 <head> |
6 <script type="text/javascript" src="nacltest.js"></script> | 6 <script type="text/javascript" src="nacltest.js"></script> |
7 <script type="application/x-javascript"> | 7 <script type="application/x-javascript"> |
8 //<![CDATA[ | 8 //<![CDATA[ |
9 function iframe_loaded() { | 9 function iframe_loaded() { |
10 var iframe_doc = window.frames['iframe_id'].document; | 10 var iframe_doc = window.frames['iframe_name'].document; |
11 var iframe_body = iframe_doc.body; | 11 var iframe_body = iframe_doc.body; |
12 var tester = new Tester(); | 12 var tester = new Tester(); |
13 // 'plugin' is the name given to the embed by webkit | 13 // 'plugin' is the name given to the embed by webkit |
14 var plugin = iframe_doc.getElementsByName('plugin')[0]; | 14 var plugin = iframe_doc.getElementsByName('plugin')[0]; |
15 | 15 |
16 function addTest(test_name, responses) { | 16 function addTest(test_name, responses) { |
17 if (responses === undefined) { | 17 if (responses === undefined) { |
18 responses = []; | 18 responses = []; |
19 } | 19 } |
20 var expected_messages = [test_name + ':PASSED'].concat(responses); | 20 var expected_messages = [test_name + ':PASSED'].concat(responses); |
21 tester.addAsyncTest(test_name, function(test) { | 21 tester.addAsyncTest(test_name, function(test) { |
22 test.expectMessageSequence(plugin, expected_messages); | 22 test.expectMessageSequence(plugin, expected_messages); |
23 plugin.postMessage(test_name) | 23 plugin.postMessage(test_name) |
24 }); | 24 }); |
25 } | 25 } |
26 | 26 |
27 addTest('TestHandleDocumentLoad'); | 27 addTest('TestHandleDocumentLoad'); |
28 addTest('TestIsFullFrame'); | 28 addTest('TestIsFullFrame'); |
29 tester.waitFor(plugin); | 29 tester.waitFor(plugin); |
30 tester.run(); | 30 tester.run(); |
31 } | 31 } |
32 //]]> | 32 //]]> |
33 </script> | 33 </script> |
34 <title>PPAPI Extension MIME Type Test</title> | 34 <title>PPAPI Extension MIME Type Test</title> |
35 </head> | 35 </head> |
36 <body> | 36 <body> |
37 <h1>PPAPI Extension MIME Type Test</h1> | 37 <h1>PPAPI Extension MIME Type Test</h1> |
38 <iframe src='mime_test_data.dat' | 38 <iframe src='mime_test_data.dat' |
39 id='iframe_id' | 39 name='iframe_name' |
40 width='100' | 40 width='100' |
41 height='100' | 41 height='100' |
42 onload='iframe_loaded()'> | 42 onload='iframe_loaded()'> |
43 </iframe> | 43 </iframe> |
44 </body> | 44 </body> |
45 </html> | 45 </html> |
OLD | NEW |