From b68eda3015630b3e237956af5c7d8a8bf7161cf6 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Mon, 31 Mar 2014 15:08:56 -0400 Subject: [PATCH] Bug 987387 - Part 2: Add a test to ensure that sendBeacon respects private browsing by checking to see if a private cookie is set when calling sendBeacon in private browsing mode; r=jdm --- dom/tests/mochitest/beacon/chrome.ini | 6 ++ .../mochitest/beacon/file_beaconCookies.html | 8 ++ dom/tests/mochitest/beacon/mochitest.ini | 2 - dom/tests/mochitest/beacon/moz.build | 1 + .../mochitest/beacon/test_beaconCookies.html | 79 +++++++++++++------ 5 files changed, 70 insertions(+), 26 deletions(-) create mode 100644 dom/tests/mochitest/beacon/chrome.ini create mode 100644 dom/tests/mochitest/beacon/file_beaconCookies.html diff --git a/dom/tests/mochitest/beacon/chrome.ini b/dom/tests/mochitest/beacon/chrome.ini new file mode 100644 index 000000000000..584becfbf499 --- /dev/null +++ b/dom/tests/mochitest/beacon/chrome.ini @@ -0,0 +1,6 @@ +[DEFAULT] +skip-if = buildapp == 'b2g' || e10s + +[test_beaconCookies.html] +support-files = beacon-set-cookie.sjs + file_beaconCookies.html diff --git a/dom/tests/mochitest/beacon/file_beaconCookies.html b/dom/tests/mochitest/beacon/file_beaconCookies.html new file mode 100644 index 000000000000..aeecb2263ee8 --- /dev/null +++ b/dom/tests/mochitest/beacon/file_beaconCookies.html @@ -0,0 +1,8 @@ + + diff --git a/dom/tests/mochitest/beacon/mochitest.ini b/dom/tests/mochitest/beacon/mochitest.ini index 0ab1ab5567ef..f65276e4a99c 100644 --- a/dom/tests/mochitest/beacon/mochitest.ini +++ b/dom/tests/mochitest/beacon/mochitest.ini @@ -2,10 +2,8 @@ skip-if = buildapp == 'b2g' || e10s support-files = beacon-frame.html beacon-handler.sjs - beacon-set-cookie.sjs [test_beacon.html] [test_beaconFrame.html] [test_beaconPreflight.html] -[test_beaconCookies.html] [test_beaconContentPolicy.html] diff --git a/dom/tests/mochitest/beacon/moz.build b/dom/tests/mochitest/beacon/moz.build index 3cf16eb0cfe8..76deffb6d1f3 100644 --- a/dom/tests/mochitest/beacon/moz.build +++ b/dom/tests/mochitest/beacon/moz.build @@ -5,4 +5,5 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. MOCHITEST_MANIFESTS += ['mochitest.ini'] +MOCHITEST_CHROME_MANIFESTS += ['chrome.ini'] diff --git a/dom/tests/mochitest/beacon/test_beaconCookies.html b/dom/tests/mochitest/beacon/test_beaconCookies.html index 5d28c3fed352..e2c4f3b7d56e 100644 --- a/dom/tests/mochitest/beacon/test_beaconCookies.html +++ b/dom/tests/mochitest/beacon/test_beaconCookies.html @@ -5,8 +5,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=936340 --> Test whether sendBeacon sets cookies - - + + Mozilla Bug 936340 @@ -17,39 +17,70 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=936340