Bug 1425979 - test_migration2to3 should be executed only if in nightly, r=jkt
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 28 Dec 2017 13:56:43 +0100
changeset 449231 816fbb9103df3449ee8edb5249d3117f9fc8ba0f
parent 449230 bfae84ba89f222286c649af0148a20f1bb50c799
child 449232 15ea666d32007bbfc3df6bf710aa040a92667180
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjkt
bugs1425979
milestone59.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 1425979 - test_migration2to3 should be executed only if in nightly, r=jkt
toolkit/components/contextualidentity/tests/unit/test_migration2to3.js
--- a/toolkit/components/contextualidentity/tests/unit/test_migration2to3.js
+++ b/toolkit/components/contextualidentity/tests/unit/test_migration2to3.js
@@ -2,16 +2,17 @@
 
 const profileDir = do_get_profile();
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/ContextualIdentityService.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/osfile.jsm");
+Cu.import("resource://gre/modules/AppConstants.jsm");
 
 const TEST_STORE_FILE_PATH = OS.Path.join(profileDir.path, "test-containers.json");
 
 const BASE_URL = "http://example.org/";
 
 const COOKIE = {
   host: BASE_URL,
   path: "/",
@@ -96,24 +97,30 @@ add_task(async function cookieDeleted() 
 
   let cis = ContextualIdentityService.createNewInstanceForTesting(TEST_STORE_FILE_PATH);
   ok(!!cis, "We have our instance of ContextualIdentityService");
 
   equal(cis.getPublicIdentities().length, 1, "The test file containes 1 identity");
   ok(!!cis.getPublicIdentityFromId(1), "Identity 1 exists");
 
   // Cookie is gone!
-  ok(!hasCookie(), "We should not have the new cookie!");
+  if (AppConstants.NIGHTLY_BUILD) {
+    ok(!hasCookie(), "We should not have the new cookie!");
+  } else {
+    ok(hasCookie(), "We should have the cookies in release/beta!");
+  }
 
   // Let's force the saving.
   await cis.save();
 
   // Let's be sure that the cookie is not deleted again.
-  createCookie();
-  ok(hasCookie(), "We have the new cookie!");
+  if (AppConstants.NIGHTLY_BUILD) {
+    createCookie();
+    ok(hasCookie(), "We have the new cookie!");
+  }
 
   cis = ContextualIdentityService.createNewInstanceForTesting(TEST_STORE_FILE_PATH);
   ok(!!cis, "We have our instance of ContextualIdentityService");
 
   equal(cis.getPublicIdentities().length, 1, "The test file containes 1 identity");
 
   ok(hasCookie(), "Cookie is not deleted when the file is reopened");
 });