Backed out changeset a844765fb5d9 (bug 806127)

This commit is contained in:
Justin Lebar 2012-10-30 21:35:46 -04:00
parent 8edd729020
commit afd32ab538
5 changed files with 0 additions and 105 deletions

View File

@ -90,9 +90,6 @@ MOCHITEST_FILES = \
test_browserElement_inproc_PromptCheck.html \
browserElement_PromptConfirm.js \
test_browserElement_inproc_PromptConfirm.html \
browserElement_CookiesNotThirdParty.js \
file_browserElement_CookiesNotThirdParty.html \
test_browserElement_inproc_CookiesNotThirdParty.html \
browserElement_Close.js \
test_browserElement_inproc_Close.html \
browserElement_CloseFromOpener.js \
@ -197,7 +194,6 @@ MOCHITEST_FILES += \
test_browserElement_oop_TargetBlank.html \
test_browserElement_oop_PromptCheck.html \
test_browserElement_oop_PromptConfirm.html \
test_browserElement_oop_CookiesNotThirdParty.html \
test_browserElement_oop_Close.html \
test_browserElement_oop_CloseFromOpener.html \
test_browserElement_oop_CloseApp.html \

View File

@ -1,50 +0,0 @@
/* Any copyright is dedicated to the public domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Bug 806127 - Test that cookies set by <iframe mozbrowser> are not considered
// third-party.
"use strict";
SimpleTest.waitForExplicitFinish();
function runTest() {
browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
const innerPage = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_CookiesNotThirdParty.html';
var iframe = document.createElement('iframe');
iframe.mozbrowser = true;
iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
if (e.detail.message == 'next') {
iframe.src = innerPage + '?step=2';
return;
}
if (e.detail.message.startsWith('success:')) {
ok(true, e.detail.message);
return;
}
if (e.detail.message.startsWith('failure:')) {
ok(false, e.detail.message);
return;
}
if (e.detail.message == 'finish') {
SimpleTest.finish();
}
});
// innerPage will set a cookie and then alert('next'). We'll load
// innerPage?step=2. That page will check that the cooke exists (despite the
// fact that we've disabled third-party cookies) and alert('success:') or
// alert('failure:'), as appropriate. Finally, the page will
// alert('finish');
iframe.src = innerPage;
document.body.appendChild(iframe);
}
// Disable third-party cookies for this test.
SpecialPowers.pushPrefEnv({'set': [['network.cookie.cookieBehavior', 1]]}, runTest);

View File

@ -1,25 +0,0 @@
<html>
<body>
file_browserElement_CookiesNotThirdParty.html
<script type='text/javascript;version=1.7'>
if (location.search != '?step=2') {
// Step 1: Set a cookie.
document.cookie = 'file_browserElement_CookiesNotThirdParty';
alert('next');
}
else {
// Step 2: Read the cookie.
if (document.cookie == 'file_browserElement_CookiesNotThirdParty') {
alert('success: got the correct cookie');
}
else {
alert('failure: got unexpected cookie: "' + document.cookie + '"');
}
alert('finish');
}
</script>
</body>
</html>

View File

@ -1,13 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Bug 806127</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script type="application/javascript;version=1.7" src="browserElement_CookiesNotThirdParty.js">
</script>
</body>
</html>

View File

@ -1,13 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Bug 806127</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script type="application/javascript;version=1.7" src="browserElement_CookiesNotThirdParty.js">
</script>
</body>
</html>