Bug 1618507 - Port bug 1604212: Set network.cookie.sameSite.laxByDefault to false for now. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Sat, 29 Feb 2020 20:50:40 +0100
changeset 37450 0ebeb53641ffc6ba167f05f26ab585ad11371b93
parent 37449 4ca5a41330ff98c4d610b53f38b9ac2268ef15be
child 37451 75a31575b246dd02422dd52f32bae9461c8ee33d
push id2566
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:20:31 +0000
treeherdercomm-beta@a352facfa0a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1618507, 1604212
Bug 1618507 - Port bug 1604212: Set network.cookie.sameSite.laxByDefault to false for now. rs=bustage-fix
mailnews/base/test/TestMailCookie.cpp
--- a/mailnews/base/test/TestMailCookie.cpp
+++ b/mailnews/base/test/TestMailCookie.cpp
@@ -9,18 +9,18 @@
 #include "nsICookieManager.h"
 #include "nsICookie.h"
 #include <stdio.h>
 #include "plstr.h"
 #include "prprf.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
 #include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nsServiceManagerUtils.h"
+#include "mozilla/Preferences.h"
 #include "mozilla/Unused.h"
 #include "nsIURI.h"
 
 using mozilla::Unused;
 
 static NS_DEFINE_CID(kCookieServiceCID, NS_COOKIESERVICE_CID);
 static NS_DEFINE_CID(kPrefServiceCID, NS_PREFSERVICE_CID);
 
@@ -98,16 +98,19 @@ void InitPrefsMail(nsIPrefBranch *aPrefB
   // however, we don't test third party blocking here.
   aPrefBranch->SetIntPref(kCookiesPermissions, 0);  // accept all
   aPrefBranch->SetBoolPref(kCookiesLifetimeEnabled, true);
   aPrefBranch->SetIntPref(kCookiesLifetimeCurrentSession, 0);
   aPrefBranch->SetIntPref(kCookiesLifetimeDays, 1);
   aPrefBranch->SetBoolPref(kCookiesAskPermission, false);
   // Set the base domain limit to 50 so we have a known value.
   aPrefBranch->SetIntPref(kCookiesMaxPerHost, 50);
+
+  // XXX TODO: We need to follow bug 1617611 for the real fix.
+  mozilla::Preferences::SetBool("network.cookie.sameSite.laxByDefault", false);
 }
 
 TEST(TestMailCookie, TestMailCookieMain)
 {
   nsresult rv0;
 
   nsCOMPtr<nsICookieService> cookieService =
       do_GetService(kCookieServiceCID, &rv0);