Bug 1850713: remove duplicated setting of early hint preloader id in `ScriptLoader...
[gecko.git] / dom / payments / test / test_block_none10s.html
blobb1d654f38c1bcac8d22f1f5b56aa66b55ae69cb3
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Test for Bug 1408250</title>
5 <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
6 <meta content="utf-8" http-equiv="encoding">
7 <script src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="text/javascript">
10 "use strict";
11 SimpleTest.waitForExplicitFinish();
13 function testInNone10s() {
14 return new Promise((resolve,reject) => {
15 const supportedInstruments = [{
16 supportedMethods: "basic-card",
17 }];
18 const details = {
19 id: "simple details",
20 total: {
21 label: "Donation",
22 amount: { currency: "USD", value: "55.00" }
25 try {
26 const payRequest = new PaymentRequest(supportedInstruments, details);
27 ok(false, "Unexpected, new PaymentRequest() can not be used in non-e10s.");
28 } catch (err) {
29 ok(err.name, "ReferenceError",
30 "Expected ReferenceError when calling new PaymentRequest()");
32 resolve();
34 });
37 function runTests() {
38 testInNone10s()
39 .then(SimpleTest.finish)
40 .catch( e => {
41 ok(false, "Unexpected error: " + e.name);
42 SimpleTest.finish();
43 });
46 window.addEventListener('load', function() {
47 SpecialPowers.pushPrefEnv({
48 'set': [
49 ['dom.payments.request.enabled', true],
51 }, runTests);
52 });
53 </script>
54 </head>
55 <body>
56 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1408250">Mozilla Bug 1408250</a>
57 </body>
58 </html>