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.
8 <title>PNaCl Request Header Test
</title>
11 <script type=
"text/javascript" src=
"../load_util.js"></script>
13 function create(manifest_urls
, index
) {
14 if (manifest_urls
.length
== index
) {
15 load_util
.shutdown(index
+ " test(s) passed.", true);
18 var embed
= document
.createElement("embed");
19 if (manifest_urls
[index
].cors
) {
20 embed
.src
= load_util
.crossOriginURL(manifest_urls
[index
].url
);
22 embed
.src
= manifest_urls
[index
].url
;
24 embed
.type
= "application/x-pnacl";
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.
30 {type
: "Log", message
: "Expected error: " + embed
.lastError
});
31 create(manifest_urls
, index
+ 1);
34 document
.body
.appendChild(embed
);
37 var tests
= [{url
: "pnacl_request_header.nmf", cors
: false},
38 {url
: "pnacl_cors_header.nmf", cors
: true}];