navigator-subapp.https.html (1085B)
1 <!DOCTYPE html> 2 <title>navigator.subApp API test</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/common/utils.js"></script> 6 <script src="/common/dispatcher/dispatcher.js"></script> 7 <script src="resources/utils.js"></script> 8 9 <body> 10 <script> 11 promise_test(async () => { 12 const frame = attachFencedFrameContext(); 13 const result = await frame.execute(async () => { 14 const expected_error_message = 15 'Cannot read properties of undefined (reading \'list\')'; 16 try { 17 const list = await navigator.subApps.list(); 18 return 'navigator.subApps.list() succeeded'; 19 } catch (e) { 20 if (e.name === 'TypeError' && 21 e.message === expected_error_message) { 22 return 'navigator.subApps.list() was disallowed'; 23 } 24 return 'navigator.subApps.list() failed with unknown error' + 25 `${e.name} ${e.message}`; 26 } 27 }); 28 assert_equals(result, 'navigator.subApps.list() was disallowed'); 29 }, 'navigator.subApps.list() should fail in the fenced frame.'); 30 </script>