Bug 1189842 - Change sync post-login page (about:accounts) to instead direct to account:preferences#sync. r=markh
authorEdouard Oger <edouard.oger@gmail.com>
Sat, 15 Aug 2015 16:39:05 +1000
changeset 257917 9a5f3dd7d1c05344cd082db09eec8892faefc2f9
parent 257903 2ddfc9180971a212127a370911ba2e8ef36a6605
child 257918 462b94db33352190aea305dcd461f9c89cf295d2
push id29237
push userryanvm@gmail.com
push dateMon, 17 Aug 2015 12:55:19 +0000
treeherdermozilla-central@0a7e118ca369 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1189842
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1189842 - Change sync post-login page (about:accounts) to instead direct to account:preferences#sync. r=markh
browser/base/content/aboutaccounts/aboutaccounts.js
browser/base/content/test/general/browser_aboutAccounts.js
browser/base/content/test/general/content_aboutAccounts.js
--- a/browser/base/content/aboutaccounts/aboutaccounts.js
+++ b/browser/base/content/aboutaccounts/aboutaccounts.js
@@ -232,17 +232,17 @@ let wrapper = {
               .wrappedJSObject;
     xps.whenLoaded().then(() => {
       updateDisplayedEmail(accountData);
       return fxAccounts.setSignedInUser(accountData);
     }).then(() => {
       // If the user data is verified, we want it to immediately look like
       // they are signed in without waiting for messages to bounce around.
       if (accountData.verified) {
-        show("stage", "manage");
+        openPrefs();
       }
       this.injectData("message", { status: "login" });
       // until we sort out a better UX, just leave the jelly page in place.
       // If the account email is not yet verified, it will tell the user to
       // go check their email, but then it will *not* change state after
       // the verification completes (the browser will begin syncing, but
       // won't notify the user). If the email has already been verified,
       // the jelly will say "Welcome! You are successfully signed in as
--- a/browser/base/content/test/general/browser_aboutAccounts.js
+++ b/browser/base/content/test/general/browser_aboutAccounts.js
@@ -34,27 +34,30 @@ registerCleanupFunction(function() {
   }
 });
 
 let gTests = [
 {
   desc: "Test the remote commands",
   teardown: function* () {
     gBrowser.removeCurrentTab();
-    yield fxAccounts.signOut();
+    yield signOut();
   },
   run: function* ()
   {
     setPref("identity.fxaccounts.remote.signup.uri",
             "https://example.com/browser/browser/base/content/test/general/accounts_testRemoteCommands.html");
     let tab = yield promiseNewTabLoadEvent("about:accounts");
     let mm = tab.linkedBrowser.messageManager;
 
     let deferred = Promise.defer();
 
+    // We'll get a message when openPrefs() is called, which this test should
+    // arrange.
+    let promisePrefsOpened = promiseOneMessage(tab, "test:openPrefsCalled");
     let results = 0;
     try {
       mm.addMessageListener("test:response", function responseHandler(msg) {
         let data = msg.data.data;
         if (data.type == "testResult") {
           ok(data.pass, data.info);
           results++;
         } else if (data.type == "testsComplete") {
@@ -63,16 +66,17 @@ let gTests = [
           deferred.resolve();
         }
       });
     } catch(e) {
       ok(false, "Failed to get all commands");
       deferred.reject();
     }
     yield deferred.promise;
+    yield promisePrefsOpened;
   }
 },
 {
   desc: "Test action=signin - no user logged in",
   teardown: () => gBrowser.removeCurrentTab(),
   run: function* ()
   {
     // When this loads with no user logged-in, we expect the "normal" URL
--- a/browser/base/content/test/general/content_aboutAccounts.js
+++ b/browser/base/content/test/general/content_aboutAccounts.js
@@ -8,16 +8,22 @@
 const {interfaces: Ci, utils: Cu} = Components;
 
 addEventListener("load", function load(event) {
   if (event.target != content.document) {
     return;
   }
 //  content.document.removeEventListener("load", load, true);
   sendAsyncMessage("test:document:load");
+  // Opening Sync prefs in tests is a pain as leaks are reported due to the
+  // in-flight promises. For now we just mock the openPrefs() function and have
+  // it send a message back to the test so we know it was called.
+  content.openPrefs = function() {
+    sendAsyncMessage("test:openPrefsCalled");
+  }
 }, true);
 
 addEventListener("DOMContentLoaded", function domContentLoaded(event) {
   removeEventListener("DOMContentLoaded", domContentLoaded, true);
   let iframe = content.document.getElementById("remote");
   if (!iframe) {
     // at least one test initially loads about:blank - in that case, we are done.
     return;