test_block_none10s.html (1615B)
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> 8 9 <script type="text/javascript"> 10 "use strict"; 11 SimpleTest.waitForExplicitFinish(); 12 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" } 23 }, 24 }; 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()"); 31 } 32 resolve(); 33 34 }); 35 } 36 37 function runTests() { 38 testInNone10s() 39 .then(SimpleTest.finish) 40 .catch( e => { 41 ok(false, "Unexpected error: " + e.name); 42 SimpleTest.finish(); 43 }); 44 } 45 46 window.addEventListener('load', function() { 47 SpecialPowers.pushPrefEnv({ 48 'set': [ 49 ['dom.payments.request.enabled', true], 50 ] 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>