Extend the enterprise policy for SSL overrides to the "danger" command
[chromium-blink-merge.git] / ppapi / native_client / tests / nacl_browser / inbrowser_test_runner / test_runner.html
blob5ecd04ae52800571a8fdbb63e6fd9db5527d3168
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7 <html>
8 <head>
9 <title>
10 NativeClient browser test runner
11 </title>
12 <script type="text/javascript" src="nacltest.js"></script>
13 <script type="text/javascript" src="nmf_test_list.js"></script>
14 </head>
15 <body>
17 <div id="scratch_space"></div>
19 <div id="load_warning">
20 Javascript has failed to load.
21 </div>
23 <script type="text/javascript">
25 function addTest(tester, url) {
26 tester.addAsyncTest(url, function(status) {
27 var embed = document.createElement('embed');
28 embed.width = 0;
29 embed.height = 0;
30 embed.src = url;
31 embed.type = 'application/x-nacl';
32 embed.name = 'foo';
34 // Webkit Bug Workaround
35 // THIS SHOULD BE REMOVED WHEN Webkit IS FIXED
36 // http://code.google.com/p/nativeclient/issues/detail?id=2428
37 // http://code.google.com/p/chromium/issues/detail?id=103588
38 ForcePluginLoadOnTimeout(embed, tester, 15000);
40 var div = document.createElement('div');
41 div.appendChild(embed);
43 var cleanup = function() {
44 document.getElementById('scratch_space').removeChild(div);
47 // Set up an event listener for success messages.
48 div.addEventListener('message', status.wrap(function(message_event) {
49 status.assertEqual(message_event.data, 'passed');
50 cleanup();
51 status.pass();
52 }), true);
54 // Wait for the load event, which indicates successful loading.
55 div.addEventListener('load', status.wrap(function(e) {
56 status.log('Loaded ' + embed.src);
57 // Start tests in the module.
58 embed.postMessage('run_tests');
59 }), true);
61 var onError = status.wrap(function(e) {
62 cleanup();
63 status.fail(embed.lastError);
64 });
66 div.addEventListener('error', onError, true);
67 div.addEventListener('crash', onError, true);
69 // Insert div into the DOM. This starts the load of the nacl plugin, etc.
70 document.getElementById('scratch_space').appendChild(div);
71 });
74 // Remove the "failed to load" message.
75 document.getElementById('load_warning').innerHTML = '';
77 var tester = new Tester();
78 for (var i = 0; i < G_NMF_TEST_LIST.length; i++) {
79 addTest(tester, G_NMF_TEST_LIST[i]);
82 var args = getTestArguments({'parallel': '0'});
84 if (parseInt(args['parallel'])) {
85 tester.runParallel();
86 } else {
87 tester.run();
90 </script>
91 </body>
92 </html>