PresentationRequest_success.https.html (1516B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Constructing a PresentationRequest</title> 4 <link rel="author" title="Franck William Taffo" href="http://www.fokus.fraunhofer.de"> 5 <link rel="author" title="Tomoyuki Shimizu" href="https://github.com/tomoyukilabs/"> 6 <link rel="help" href="http://w3c.github.io/presentation-api/#constructing-a-presentationrequest"> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 10 <script> 11 test(() => { 12 let request = new PresentationRequest('presentation.html'); 13 assert_true(request instanceof PresentationRequest, 'An instance of PresentationRequest with a relative presentation URL is constructed successfully.'); 14 15 request = new PresentationRequest('https://example.org/'); 16 assert_true(request instanceof PresentationRequest, 'An instance of PresentationRequest with an absolute presentation URL is constructed successfully.'); 17 18 request = new PresentationRequest([ 19 'presentation.html', 20 'https://example.org/presentation/' 21 ]); 22 assert_true(request instanceof PresentationRequest, 'An instance of PresentationRequest with an array of presentation URLs is constructed successfully.'); 23 24 request = new PresentationRequest([ 25 'unsupported://example.com', 26 'presentation.html', 27 'https://example.org/presentation/' 28 ]); 29 assert_true(request instanceof PresentationRequest, 'An unsupported URL in an array of presentation URLs is ignored successfully.'); 30 }); 31 </script>