Merge mozilla-release to esr60. a=merge
authorRyan VanderMeulen <ryanvm@gmail.com>
Sat, 28 Apr 2018 12:50:07 -0400
changeset 790944 91d3402ec1c8b00f83ce8f9fc8ce09cba456ff6d
parent 790943 f8ab4e05a997625118dbb04a30ec0f4308a52a40 (current diff)
parent 790453 19a40f67957ad73076766776cf0fab0709e5712d (diff)
child 790945 7055a4f07f2df099a8963556b333904184eb7786
push id108656
push userbmo:jlorenzo@mozilla.com
push dateThu, 03 May 2018 08:03:49 +0000
reviewersmerge
milestone60.0
Merge mozilla-release to esr60. a=merge
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -645,22 +645,22 @@ notification[value="translation"] menuli
 @media (-moz-gtk-csd-available) {
   :root[tabsintitlebar] > #titlebar:-moz-lwtheme {
     visibility: hidden;
   }
   :root[tabsintitlebar] #titlebar-content:-moz-lwtheme {
     visibility: visible;
   }
 
+  :root[tabsintitlebar] > #titlebar {
+    -moz-appearance: -moz-window-titlebar-maximized;
+  }
   :root[tabsintitlebar][sizemode="normal"] > #titlebar {
     -moz-appearance: -moz-window-titlebar;
   }
-  :root[tabsintitlebar][sizemode="maximized"] > #titlebar {
-    -moz-appearance: -moz-window-titlebar-maximized;
-  }
 
   /* Add extra space to titlebar for dragging */
   :root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar,
   :root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar {
     padding-top: var(--space-above-tabbar);
   }
 
   /* Private browsing and accessibility indicators */
@@ -669,17 +669,18 @@ notification[value="translation"] menuli
   :root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .private-browsing-indicator,
   :root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .accessibility-indicator {
     padding-top: calc(-1 * var(--space-above-tabbar));
   }
 
   /* Make #TabsToolbar transparent as we style underlying #titlebar with
    * -moz-window-titlebar (Gtk+ theme).
    */
-  :root[tabsintitlebar] #TabsToolbar,
+  :root[tabsintitlebar][sizemode="normal"]:not([inFullscreen]) #TabsToolbar,
+  :root[tabsintitlebar][sizemode="maximized"] #TabsToolbar,
   :root[tabsintitlebar] #toolbar-menubar {
     -moz-appearance: none;
   }
 
   /* The button box must appear on top of the navigator-toolbox in order for
    * click and hover mouse events to work properly for the button in the restored
    * window state. Otherwise, elements in the navigator-toolbox, like the menubar,
    * can swallow those events.
--- a/mobile/android/base/java/org/mozilla/gecko/AccountsHelper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/AccountsHelper.java
@@ -187,16 +187,17 @@ public class AccountsHelper implements B
                 return;
             }
 
             final State state = new Engaged(email, uid, verified, unwrapkB,
                                             sessionToken, keyFetchToken);
 
             final AndroidFxAccount fxAccount = new AndroidFxAccount(mContext, account);
             fxAccount.setState(state);
+            fxAccount.updateFirstRunScope(mContext);
 
             if (callback != null) {
                 callback.sendSuccess(true);
             }
 
         } else if ("Accounts:Create".equals(event)) {
             // Do exactly the same thing as if you tapped 'Sync' in Settings.
             final Intent intent = new Intent(FxAccountConstants.ACTION_FXA_GET_STARTED);
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java
@@ -640,16 +640,30 @@ public class AndroidFxAccount {
    */
   private static void optionallyTagWithFirstRunScope(final Context context, final Bundle userdata) {
     final String firstRunUUID = EnvironmentUtils.firstRunUUID(context);
     if (firstRunUUID != null) {
       userdata.putString(ACCOUNT_KEY_FIRST_RUN_SCOPE, firstRunUUID);
     }
   }
 
+  /**
+   * If there's an active First Run session, tag the given account with it.  If
+   * there's no active First Run session, remove any existing tag.  We do this
+   * in order to reliably determine if an account was created during the current
+   * "first run"; this allows us to re-connect an account that was not created
+   * during the current "first run".
+   *
+   * See {@link FirefoxAccounts#optionallySeparateAccountsDuringFirstRun} for details.
+   */
+  public void updateFirstRunScope(final Context context) {
+    String firstRunUUID = EnvironmentUtils.firstRunUUID(context);
+    accountManager.setUserData(account, ACCOUNT_KEY_FIRST_RUN_SCOPE, firstRunUUID);
+  }
+
   private void clearSyncPrefs() throws UnsupportedEncodingException, GeneralSecurityException {
     getSyncPrefs().edit().clear().apply();
   }
 
   private void setAuthoritiesToSyncAutomaticallyMap(Map<String, Boolean> authoritiesToSyncAutomaticallyMap) {
     if (authoritiesToSyncAutomaticallyMap == null) {
       throw new IllegalArgumentException("authoritiesToSyncAutomaticallyMap must not be null");
     }
--- a/netwerk/test/browser/browser.ini
+++ b/netwerk/test/browser/browser.ini
@@ -5,8 +5,9 @@ support-files =
 [browser_about_cache.js]
 [browser_NetUtil.js]
 [browser_child_resource.js]
 skip-if = !crashreporter || (e10s && debug && os == "linux" && bits == 64) || debug # Bug 1370783
 [browser_post_file.js]
 [browser_nsIFormPOSTActionChannel.js]
 skip-if = e10s # protocol handler and channel does not work in content process
 [browser_resource_navigation.js]
+[browser_cookie_sync_across_tabs.js]
new file mode 100644
--- /dev/null
+++ b/netwerk/test/browser/browser_cookie_sync_across_tabs.js
@@ -0,0 +1,65 @@
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+"use strict";
+
+add_task(async function() {
+  info("Make sure cookie changes in one process are visible in the other");
+
+  const kRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/",
+                                                    "https://example.com/");
+  const kTestPage = kRoot + "dummy.html";
+
+  Services.cookies.removeAll();
+
+  let tab1 = await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: kTestPage, forceNewProcess: true });
+  let tab2 = await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: kTestPage, forceNewProcess: true });
+
+  let browser1 = gBrowser.getBrowserForTab(tab1);
+  let browser2 = gBrowser.getBrowserForTab(tab2);
+
+  let pid1 = browser1.frameLoader.tabParent.osPid;
+  let pid2 = browser2.frameLoader.tabParent.osPid;
+
+  // Note, this might not be true once fission is implemented (Bug 1451850)
+  ok(pid1 != pid2, "We should have different processes here.");
+
+  await ContentTask.spawn(browser1, null, async function() {
+    is(content.document.cookie, "", "Expecting no cookies");
+  });
+
+  await ContentTask.spawn(browser2, null, async function() {
+    is(content.document.cookie, "", "Expecting no cookies");
+  });
+
+  await ContentTask.spawn(browser1, null, async function() {
+    content.document.cookie = "a1=test";
+  });
+
+  await ContentTask.spawn(browser2, null, async function() {
+    is(content.document.cookie, "a1=test", "Cookie should be set");
+    content.document.cookie = "a1=other_test";
+  });
+
+  await ContentTask.spawn(browser1, null, async function() {
+    is(content.document.cookie, "a1=other_test", "Cookie should be set");
+    content.document.cookie = "a2=again";
+  });
+
+  await ContentTask.spawn(browser2, null, async function() {
+    is(content.document.cookie, "a1=other_test; a2=again", "Cookie should be set");
+    content.document.cookie = "a1=; expires=Thu, 01-Jan-1970 00:00:01 GMT;";
+    content.document.cookie = "a2=; expires=Thu, 01-Jan-1970 00:00:01 GMT;";
+  });
+
+  await ContentTask.spawn(browser1, null, async function() {
+    is(content.document.cookie, "", "Cookies should be cleared");
+  });
+
+  BrowserTestUtils.removeTab(tab1);
+  BrowserTestUtils.removeTab(tab2);
+
+  ok(true, "Got to the end of the test!");
+});
--- a/taskcluster/docker/firefox-snap/snapcraft.yaml.in
+++ b/taskcluster/docker/firefox-snap/snapcraft.yaml.in
@@ -32,16 +32,18 @@ apps:
       - x11
 
 plugs:
   browser-sandbox:
     interface: browser-support
     allow-sandbox: true
 
 parts:
+  desktop-gtk3:
+    source-commit: 6a600b00773e8e4624aa12ee1f8e013ba9f2fc03
   firefox:
     plugin: dump
     source: source
     stage-packages:
       - libxt6
       - libdbus-glib-1-2
       - libasound2
       - libpulse0