addWindow-invalid-origin.window.js (738B)
1 // META: title=RemoteContextHelper addWindow with extra config 2 // META: script=/common/dispatcher/dispatcher.js 3 // META: script=/common/get-host-info.sub.js 4 // META: script=/common/utils.js 5 // META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js 6 // META: script=./resources/test-helper.js 7 8 'use strict'; 9 10 // This tests that arguments passed to the constructor are respected. 11 promise_test(async t => { 12 const header1Name = 'x-wpt-test-header1'; 13 const header1Value = 'test-escaping1()'; 14 const rcHelper = new RemoteContextHelper({ 15 origin: 'INVALID', 16 }); 17 18 promise_rejects_js( 19 t, RangeError, rcHelper.addWindow(), 20 'Exception should be thrown for invalid origin.'); 21 });