OLD | NEW |
---|---|
1 <html><head> | 1 <html><head> |
2 <link rel="stylesheet" href="test_page.css"> | 2 <link rel="stylesheet" href="test_page.css"> |
3 <script> | 3 <script> |
4 function AdjustHeight(frameWin) { | 4 function AdjustHeight(frameWin) { |
5 var div = frameWin.document.getElementsByTagName("div")[0]; | 5 var div = frameWin.document.getElementsByTagName("div")[0]; |
6 var height = frameWin.getComputedStyle(div).height; | 6 var height = frameWin.getComputedStyle(div).height; |
7 frameWin.frameElement.style.height = height; | 7 frameWin.frameElement.style.height = height; |
8 } | 8 } |
9 | 9 |
10 function DidExecuteTests() { | 10 function DidExecuteTests() { |
(...skipping 30 matching lines...) Expand all Loading... | |
41 function RunAll() { | 41 function RunAll() { |
42 // Remove any existing frames. | 42 // Remove any existing frames. |
43 var existing = document.getElementsByClassName("frame-container"); | 43 var existing = document.getElementsByClassName("frame-container"); |
44 while (existing.length) | 44 while (existing.length) |
45 existing[0].parentNode.removeChild(existing[0]); | 45 existing[0].parentNode.removeChild(existing[0]); |
46 | 46 |
47 // Add new frames for each test, but do so one frame at a time. | 47 // Add new frames for each test, but do so one frame at a time. |
48 LoadNext(0); | 48 LoadNext(0); |
49 } | 49 } |
50 | 50 |
51 function ExtractSearchParameter( name ) { | |
darin (slow to review)
2010/11/16 00:23:20
style nit: no spaces around the parameter name
| |
52 var nameIndex = location.search.indexOf(name + "="); | |
53 if (nameIndex != -1) { | |
54 var value = location.search.substring(nameIndex + name.length + 1); | |
55 var endIndex = value.indexOf("&"); | |
56 if (endIndex != -1) | |
57 value = value.substring(0, endIndex); | |
58 return value; | |
59 } | |
60 return ""; | |
61 } | |
62 | |
51 onload = function() { | 63 onload = function() { |
52 var mimeType = "application/x-ppapi-tests"; | 64 var testcase = ExtractSearchParameter("testcase"); |
53 if (mimeType in navigator.mimeTypes) { | 65 var mode = ExtractSearchParameter("mode"); |
54 var testcase = location.search.substring(1); | 66 document.title = 'Test ' + testcase; |
55 document.title = 'Test ' + testcase; | 67 var obj; |
56 | 68 if (mode == "nacl") { |
57 var obj = document.createElement("OBJECT"); | 69 var nexes = "ARM: ppapi_tests_arm.nexe \nx86-32: ppapi_tests.nexe \nx86-64: ppapi_tests_x86_64."; |
70 obj = document.createElement("OBJECT"); | |
71 obj.setAttribute("type", "application/x-ppapi-nacl-srpc"); | |
72 obj.setAttribute("nexes", nexes); | |
73 obj.setAttribute("mode", mode); | |
74 } else { | |
75 var mimeType = "application/x-ppapi-tests"; | |
76 if (mimeType in navigator.mimeTypes) { | |
77 obj = document.createElement("OBJECT"); | |
78 obj.setAttribute("type", mimeType); | |
79 } else { | |
80 document.getElementById("console").innerHTML = | |
81 '<span class="fail">FAIL</span>: ' + | |
82 '<span class="err_msg">Test plug-in is not registered.</span>'; | |
83 } | |
84 } | |
85 if (obj) { | |
58 obj.setAttribute("id", "plugin"); | 86 obj.setAttribute("id", "plugin"); |
59 obj.setAttribute("type", mimeType); | |
60 obj.setAttribute("testcase", testcase); | 87 obj.setAttribute("testcase", testcase); |
61 document.getElementById("container").appendChild(obj); | 88 document.getElementById("container").appendChild(obj); |
62 } else { | |
63 document.getElementById("console").innerHTML = | |
64 '<span class="fail">FAIL</span>: ' + | |
65 '<span class="err_msg">Test plug-in is not registered.</span>'; | |
66 } | 89 } |
67 } | 90 } |
68 </script> | 91 </script> |
69 </head><body> | 92 </head><body> |
70 <div> | 93 <div> |
71 <div id="container"></div> | 94 <div id="container"></div> |
72 <div id="console" /><span class="load_msg">loading...</span></div> | 95 <div id="console" /><span class="load_msg">loading...</span></div> |
73 </div> | 96 </div> |
74 </body></html> | 97 </body></html> |
OLD | NEW |