Bug 1531153: Fix tests to also pass on dev-edition builds. r=froydnj
authorDave Townsend <dtownsend@oxymoronical.com>
Thu, 28 Feb 2019 15:38:03 +0000
changeset 519638 66ba790db6ff5210b1429173732a5816b39849d2
parent 519637 96c38e4a3d2302598a81e4928d8c9dd09b8afe08
child 519639 9450c39ec2054a0581d240e49be4917cd454fd4c
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1531153
milestone67.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 1531153: Fix tests to also pass on dev-edition builds. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D21442
toolkit/profile/xpcshell/test_skip_locked_environment.js
toolkit/profile/xpcshell/test_snatch_environment.js
toolkit/profile/xpcshell/test_snatch_environment_default.js
--- a/toolkit/profile/xpcshell/test_skip_locked_environment.js
+++ b/toolkit/profile/xpcshell/test_skip_locked_environment.js
@@ -11,17 +11,17 @@ add_task(async () => {
 
   writeCompatibilityIni(root);
 
   let profileData = {
     options: {
       startWithLastProfile: true,
     },
     profiles: [{
-      name: "Profile1",
+      name: PROFILE_DEFAULT,
       path: root.leafName,
       default: true,
     }, {
       name: "Profile2",
       path: "Path2",
     }, {
       name: "Profile3",
       path: "Path3",
@@ -56,19 +56,26 @@ add_task(async () => {
   Assert.ok(profile, "A named profile was returned.");
   Assert.equal(profile.name, DEDICATED_NAME, "The right profile name was used.");
 
   let service = getProfileService();
   Assert.equal(service.defaultProfile, profile, "Should be the default profile.");
   Assert.equal(service.currentProfile, profile, "Should be the current profile.");
 
   profileData = readProfilesIni();
+
+  if (!AppConstants.MOZ_DEV_EDITION) {
+    // On non-dev-edition builds the first two profiles are in the opposite order.
+    [profileData.profiles[1], profileData.profiles[0]] =
+        [profileData.profiles[0], profileData.profiles[1]];
+  }
+
   Assert.equal(profileData.profiles[0].name, DEDICATED_NAME, "Should be the right profile.");
   Assert.ok(!profileData.profiles[0].default, "Should not be the old default profile.");
-  Assert.equal(profileData.profiles[1].name, "Profile1", "Should be the right profile.");
+  Assert.equal(profileData.profiles[1].name, PROFILE_DEFAULT, "Should be the right profile.");
   Assert.ok(profileData.profiles[1].default, "Should be the old default profile.");
   Assert.equal(profileData.profiles[1].path, root.leafName, "Should be the correct path.");
 
   let hash = xreDirProvider.getInstallHash();
   installData = readInstallsIni();
   Assert.equal(Object.keys(installData.installs).length, 2, "Should be one known install.");
   Assert.notEqual(installData.installs[hash].default, root.leafName, "Should have marked the original default profile as the default for this install.");
   Assert.ok(installData.installs[hash].locked, "Should have locked as we created the profile for this install.");
--- a/toolkit/profile/xpcshell/test_snatch_environment.js
+++ b/toolkit/profile/xpcshell/test_snatch_environment.js
@@ -11,17 +11,17 @@ add_task(async () => {
 
   writeCompatibilityIni(root);
 
   let profileData = {
     options: {
       startWithLastProfile: true,
     },
     profiles: [{
-      name: "Profile1",
+      name: PROFILE_DEFAULT,
       path: root.leafName,
       default: true,
     }, {
       name: "Profile2",
       path: "Path2",
     }, {
       name: "Profile3",
       path: "Path3",
@@ -48,24 +48,24 @@ add_task(async () => {
 
   let { rootDir, localDir, profile, didCreate } = selectStartupProfile();
   checkStartupReason("restart-claimed-default");
 
   Assert.ok(!didCreate, "Should not have created a new profile.");
   Assert.ok(rootDir.equals(root), "Should have selected the right root dir.");
   Assert.ok(localDir.equals(local), "Should have selected the right local dir.");
   Assert.ok(profile, "A named profile matches this.");
-  Assert.equal(profile.name, "Profile1", "The right profile was matched.");
+  Assert.equal(profile.name, PROFILE_DEFAULT, "The right profile was matched.");
 
   let service = getProfileService();
   Assert.equal(service.defaultProfile, profile, "Should be the default profile.");
   Assert.equal(service.currentProfile, profile, "Should be the current profile.");
 
   profileData = readProfilesIni();
-  Assert.equal(profileData.profiles[0].name, "Profile1", "Should be the right profile.");
+  Assert.equal(profileData.profiles[0].name, PROFILE_DEFAULT, "Should be the right profile.");
   Assert.ok(profileData.profiles[0].default, "Should still be the old default profile.");
 
   let hash = xreDirProvider.getInstallHash();
   installData = readInstallsIni();
   // The info about the other install will have been removed so it goes through first run on next startup.
   Assert.equal(Object.keys(installData.installs).length, 1, "Should be one known install.");
   Assert.equal(installData.installs[hash].default, root.leafName, "Should have marked the original default profile as the default for this install.");
   Assert.ok(!installData.installs[hash].locked, "Should not have locked as we're not the default app.");
--- a/toolkit/profile/xpcshell/test_snatch_environment_default.js
+++ b/toolkit/profile/xpcshell/test_snatch_environment_default.js
@@ -13,17 +13,17 @@ add_task(async () => {
 
   writeCompatibilityIni(root);
 
   let profileData = {
     options: {
       startWithLastProfile: true,
     },
     profiles: [{
-      name: "Profile1",
+      name: PROFILE_DEFAULT,
       path: root.leafName,
       default: true,
     }, {
       name: "Profile2",
       path: "Path2",
     }, {
       name: "Profile3",
       path: "Path3",
@@ -50,24 +50,24 @@ add_task(async () => {
 
   let { rootDir, localDir, profile, didCreate } = selectStartupProfile();
   checkStartupReason("restart-claimed-default");
 
   Assert.ok(!didCreate, "Should not have created a new profile.");
   Assert.ok(rootDir.equals(root), "Should have selected the right root dir.");
   Assert.ok(localDir.equals(local), "Should have selected the right local dir.");
   Assert.ok(profile, "A named profile matches this.");
-  Assert.equal(profile.name, "Profile1", "The right profile was matched.");
+  Assert.equal(profile.name, PROFILE_DEFAULT, "The right profile was matched.");
 
   let service = getProfileService();
   Assert.equal(service.defaultProfile, profile, "Should be the default profile.");
   Assert.equal(service.currentProfile, profile, "Should be the current profile.");
 
   profileData = readProfilesIni();
-  Assert.equal(profileData.profiles[0].name, "Profile1", "Should be the right profile.");
+  Assert.equal(profileData.profiles[0].name, PROFILE_DEFAULT, "Should be the right profile.");
   Assert.ok(profileData.profiles[0].default, "Should still be the old default profile.");
 
   let hash = xreDirProvider.getInstallHash();
   installData = readInstallsIni();
   // The info about the other install will have been removed so it goes through first run on next startup.
   Assert.equal(Object.keys(installData.installs).length, 1, "Should be one known install.");
   Assert.equal(installData.installs[hash].default, root.leafName, "Should have marked the original default profile as the default for this install.");
   Assert.ok(installData.installs[hash].locked, "Should have locked as we're the default app.");