diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-05-06 20:45:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-06 20:45:22 +0200 |
commit | 5390888b97ecbd4135049c0b4a2ae0b103052a4a (patch) | |
tree | f3ddb622b21bd336384972e5461402d247478f85 /docshell/test/navigation/test_triggeringprincipal_window_open.html | |
parent | 61394bf4ff79650ee4b3f3951331c8a8775de6e3 (diff) | |
parent | 26a032c080c91ee9da347893362d5b08bc759c10 (diff) | |
download | UXP-5390888b97ecbd4135049c0b4a2ae0b103052a4a.tar UXP-5390888b97ecbd4135049c0b4a2ae0b103052a4a.tar.gz UXP-5390888b97ecbd4135049c0b4a2ae0b103052a4a.tar.lz UXP-5390888b97ecbd4135049c0b4a2ae0b103052a4a.tar.xz UXP-5390888b97ecbd4135049c0b4a2ae0b103052a4a.zip |
Merge pull request #335 from janekptacijarabaci/security_blocking_data_3
moebius#231: Consider blocking top level window data: URIs (tests)
Diffstat (limited to 'docshell/test/navigation/test_triggeringprincipal_window_open.html')
-rw-r--r-- | docshell/test/navigation/test_triggeringprincipal_window_open.html | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/docshell/test/navigation/test_triggeringprincipal_window_open.html b/docshell/test/navigation/test_triggeringprincipal_window_open.html index d5d7f210b..dbee21777 100644 --- a/docshell/test/navigation/test_triggeringprincipal_window_open.html +++ b/docshell/test/navigation/test_triggeringprincipal_window_open.html @@ -13,8 +13,7 @@ /* We call window.open() using different URIs and make sure the triggeringPrincipal * loadingPrincipal are correct. * Test1: window.open(http:) - * Test2: window.open(data:) - * Test3: window.open(javascript:) + * Test2: window.open(javascript:) */ const TRIGGERING_PRINCIPAL_URI = @@ -22,7 +21,7 @@ const TRIGGERING_PRINCIPAL_URI = SimpleTest.waitForExplicitFinish(); -const NUM_TESTS = 3; +const NUM_TESTS = 2; var test_counter = 0; function checkFinish() { @@ -54,28 +53,7 @@ httpWin.onload = function() { } // ---------------------------------------------------------------------------- -// Test 2: window.open(data:) -var dataWin = window.open("data:text/html,<html><body>data</body></html>", "_blank", "width=10,height=10"); -dataWin.onload = function() { - var dataChannel = SpecialPowers.wrap(dataWin.document).docShell.currentDocumentChannel; - var dataTriggeringPrincipal = dataChannel.loadInfo.triggeringPrincipal.URI.asciiSpec; - var dataLoadingPrincipal = dataChannel.loadInfo.loadingPrincipal; - - is(dataTriggeringPrincipal, TRIGGERING_PRINCIPAL_URI, - "TriggeringPrincipal for window.open(data:) should be the principal of the document"); - - is(dataWin.document.referrer, "", - "Referrer for window.open(data:) should be empty"); - - is(dataLoadingPrincipal, null, - "LoadingPrincipal for window.open(data:) should be null"); - - dataWin.close(); - checkFinish(); -} - -// ---------------------------------------------------------------------------- -// Test 3: window.open(javascript:) +// Test 2: window.open(javascript:) var jsWin = window.open("javascript:'<html><body>js</body></html>';", "_blank", "width=10,height=10"); jsWin.onload = function() { var jsChannel = SpecialPowers.wrap(jsWin.document).docShell.currentDocumentChannel; |