Backed out changeset 816a2cc1254a (bug 1347728) for failing xpcshell's test_blocklist_certificates.js on Windows r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 20 Apr 2017 19:11:04 +0200
changeset 354066 fb33533158025961b84732331fc4b882c7662dc1
parent 354065 99e4ae9eb731c3098a139e4d3c5d37cab0303c4e
child 354067 b80e4589fc11c2701e9e992e1ba62acf0c379b9a
child 354166 e1c9c6e89f5009d17ed4fdedc94d1f351b363da4
push id31685
push userkwierso@gmail.com
push dateThu, 20 Apr 2017 21:45:29 +0000
treeherdermozilla-central@5e3dc7e1288a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1347728
milestone55.0a1
backs out816a2cc1254aff32e4f38b9aa49bf0e18c85a045
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
Backed out changeset 816a2cc1254a (bug 1347728) for failing xpcshell's test_blocklist_certificates.js on Windows r=backout
services/common/blocklist-clients.js
services/common/tests/unit/test_blocklist_clients.js
--- a/services/common/blocklist-clients.js
+++ b/services/common/blocklist-clients.js
@@ -97,23 +97,18 @@ class BlocklistClient {
     this.signerName = signerName;
 
     this._kinto = new Kinto({
       bucket: bucketName,
       adapter: FirefoxAdapter,
     });
   }
 
-  get identifier() {
-    return `${this.bucketName}/${this.collectionName}`;
-  }
-
   get filename() {
-    const identifier = OS.Path.join(...this.identifier.split("/"));
-    return `${identifier}.json`;
+    return `${this.bucketName}/${this.collectionName}.json`;
   }
 
   /**
    * Load the the JSON file distributed with the release for this blocklist.
    *
    * For Bug 1257565 this method will have to try to load the file from the profile,
    * in order to leverage the updateJSONBlocklist() below, which writes a new
    * dump each time the collection changes.
--- a/services/common/tests/unit/test_blocklist_clients.js
+++ b/services/common/tests/unit/test_blocklist_clients.js
@@ -1,10 +1,12 @@
 const { Constructor: CC } = Components;
 
+const KEY_PROFILEDIR = "ProfD";
+
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://testing-common/httpd.js");
 Cu.import("resource://gre/modules/Timer.jsm");
 const { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
 const { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 
 const { Kinto } = Cu.import("resource://services-common/kinto-offline-client.js", {});
 const { FirefoxAdapter } = Cu.import("resource://services-common/kinto-storage-adapter.js", {});
@@ -51,20 +53,19 @@ function* clear_state() {
     try {
       sqliteHandle = yield FirefoxAdapter.openConnection({path: kintoFilename});
       const collection = kintoCollection(client.collectionName, sqliteHandle);
       yield collection.clear();
     } finally {
       yield sqliteHandle.close();
     }
 
-    // Remove JSON dumps folders in profile dir.
-    const dumpFile = OS.Path.join(OS.Constants.Path.profileDir, client.filename);
-    const folder = OS.Path.dirname(dumpFile);
-    yield OS.File.removeDir(folder, { ignoreAbsent: true });
+    // Remove profile data.
+    const path = OS.Path.join(OS.Constants.Path.profileDir, client.filename);
+    yield OS.File.remove(path, { ignoreAbsent: true });
   }
 }
 
 
 function run_test() {
   // Set up an HTTP Server
   server = new HttpServer();
   server.start(-1);
@@ -126,18 +127,17 @@ add_task(function* test_records_obtained
     equal(list.data.length, 1);
     yield sqliteHandle.close();
   }
 });
 add_task(clear_state);
 
 add_task(function* test_list_is_written_to_file_in_profile() {
   for (let {client, testData} of gBlocklistClients) {
-    const filePath = OS.Path.join(OS.Constants.Path.profileDir, client.filename);
-    const profFile = new FileUtils.File(filePath);
+    const profFile = FileUtils.getFile(KEY_PROFILEDIR, client.filename.split("/"));
     strictEqual(profFile.exists(), false);
 
     yield client.maybeSync(2000, Date.now(), {loadDump: false});
 
     strictEqual(profFile.exists(), true);
     const content = yield readJSON(profFile.path);
     equal(content.data[0].blockID, testData[testData.length - 1]);
   }
@@ -152,18 +152,17 @@ add_task(function* test_current_server_t
     equal(after, Math.round(serverTime / 1000));
   }
 });
 add_task(clear_state);
 
 add_task(function* test_update_json_file_when_addons_has_changes() {
   for (let {client, testData} of gBlocklistClients) {
     yield client.maybeSync(2000, Date.now() - 1000, {loadDump: false});
-    const filePath = OS.Path.join(OS.Constants.Path.profileDir, client.filename);
-    const profFile = new FileUtils.File(filePath);
+    const profFile = FileUtils.getFile(KEY_PROFILEDIR, client.filename.split("/"));
     const fileLastModified = profFile.lastModifiedTime = profFile.lastModifiedTime - 1000;
     const serverTime = Date.now();
 
     yield client.maybeSync(3001, serverTime);
 
     // File was updated.
     notEqual(fileLastModified, profFile.lastModifiedTime);
     const content = yield readJSON(profFile.path);
@@ -188,18 +187,17 @@ add_task(function* test_sends_reload_mes
     equal(received.data.filename, client.filename);
   }
 });
 add_task(clear_state);
 
 add_task(function* test_do_nothing_when_blocklist_is_up_to_date() {
   for (let {client} of gBlocklistClients) {
     yield client.maybeSync(2000, Date.now() - 1000, {loadDump: false});
-    const filePath = OS.Path.join(OS.Constants.Path.profileDir, client.filename);
-    const profFile = new FileUtils.File(filePath);
+    const profFile = FileUtils.getFile(KEY_PROFILEDIR, client.filename.split("/"));
     const fileLastModified = profFile.lastModifiedTime = profFile.lastModifiedTime - 1000;
     const serverTime = Date.now();
 
     yield client.maybeSync(3000, serverTime);
 
     // File was not updated.
     equal(fileLastModified, profFile.lastModifiedTime);
     // Server time was updated.