- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / nacl / pnacl_request_header / pnacl_request_header.html
1 <html>
2 <!--
3   Copyright 2013 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 <head>
8   <title>PNaCl Request Header Test</title>
9 </head>
10 <body>
11 <script type="text/javascript" src="../load_util.js"></script>
12 <script>
13 function create(manifest_urls, index) {
14   if (manifest_urls.length == index) {
15     load_util.shutdown(index + " test(s) passed.", true);
16     return;
17   }
18   var embed = document.createElement("embed");
19   if (manifest_urls[index].cors) {
20     embed.src = load_util.crossOriginURL(manifest_urls[index].url);
21   } else {
22     embed.src = manifest_urls[index].url;
23   }
24   embed.type = "application/x-pnacl";
25
26   embed.addEventListener("error", function(evt) {
27     // Since we only inspect the *request* header, we bail out with an
28     // error before completing the pexe load.
29     load_util.report(
30         {type: "Log", message: "Expected error: " + embed.lastError});
31     create(manifest_urls, index + 1);
32   }, true);
33
34   document.body.appendChild(embed);
35 }
36
37 var tests = [{url: "pnacl_request_header.nmf", cors: false},
38              {url: "pnacl_cors_header.nmf", cors: true}];
39 create(tests, 0);
40 </script>
41 </body>
42 </html>