- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / nacl / pnacl_mime_type / pnacl_mime_type.html
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 (c) 2013 The Chromium Authors. All rights reserved.
5      Use of this source code is governed by a BSD-style license that can be
6      found in the LICENSE file. -->
7 <head>
8   <title>PNaCl Mime Type Availability Test</title>
9   <meta HTTP-EQUIV="Pragma" CONTENT="no-cache" />
10   <meta HTTP-EQUIV="Expires" CONTENT="-1" />
11   <script type="text/javascript" src="nacltest.js"></script>
12 </head>
13
14 <body id="body">
15 <script type="text/javascript">
16 //<![CDATA[
17 function report(msg) {
18   domAutomationController.setAutomationId(0);
19   // The automation controller seems to choke on Objects, so turn them into
20   // strings.
21   domAutomationController.send(JSON.stringify(msg));
22 }
23
24 var pnacl_disabled = (getTestArguments()["pnacl_disabled"] !== undefined);
25 var tests = 0;
26 var errors = 0;
27
28 var pnacl_mime_type = "application/x-pnacl";
29 if (!pnacl_disabled && (navigator.mimeTypes[pnacl_mime_type] == undefined)) {
30   report({type: "Log", message: "Error: could not find " + pnacl_mime_type});
31   errors++;
32 } else if (pnacl_disabled &&
33            (navigator.mimeTypes[pnacl_mime_type] !== undefined)) {
34   report({type: "Log", message: "Error: unexpected " + pnacl_mime_type});
35   errors++;
36 }
37 tests++;
38
39 var nacl_mime_type = "application/x-nacl";
40 if (navigator.mimeTypes[nacl_mime_type] == undefined) {
41   report({type: "Log", message: "Error: could not find " + nacl_mime_type});
42   errors++;
43 }
44 tests++;
45
46 if (errors == 0) {
47   report({type: "Shutdown", message: "" + tests + " tests passed.",
48           passed: true});
49 } else {
50   report({type: "Shutdown",
51           message: "" + errors + "/" + tests + " tests failed.",
52           passed: false});
53 }
54 //]]>
55 </script>
56 </body>
57 </html>