Bug 1171687 - Part 1: Fix test_storage_mozStorage. r=dkeeler draft
authorNick Alexander <nalexander@mozilla.com>
Mon, 19 Jun 2017 11:16:55 -0700
changeset 596981 1807e3a90a4f29df1b2666b0c2fed96a79da4f1a
parent 593475 91134c95d68cbcfe984211fa3cbd28d610361ef1
child 596982 4c6a9ad508b2c8cbe8babc4985590d64fbb6ca9a
push id64786
push usernalexander@mozilla.com
push dateMon, 19 Jun 2017 22:57:09 +0000
reviewersdkeeler
bugs1171687
milestone56.0a1
Bug 1171687 - Part 1: Fix test_storage_mozStorage. r=dkeeler It appears that this test was failing only because it requires an updated key database. I did the following to produce such a key database, following the instructions at https://blogs.oracle.com/meena/whats-new-in-nss-312-new-shared-dbs: mkdir nss cp toolkit/components/passwordmgr/test/unit/data/key3.db nss/ ~/.mozbuild/host-utils.37.0a2.en-US.mac/certutil -K -d sql:nss -X cp nss/key4.db toolkit/components/passwordmgr/test/unit/data/ hg add toolkit/components/passwordmgr/test/unit/data/key4.db With these tweaks and the examplar from http://searchfox.org/mozilla-central/rev/7cc377ce3f0a569c5c9b362d589705cd4fecc0ac/security/manager/ssl/tests/unit/test_sdr_preexisting.js#176, the test passes. MozReview-Commit-ID: 6wsxL8SbNWY
toolkit/components/passwordmgr/test/unit/data/key4.db
toolkit/components/passwordmgr/test/unit/head.js
toolkit/components/passwordmgr/test/unit/xpcshell.ini
new file mode 100644
index 0000000000000000000000000000000000000000..b75a14aa8e510d95d350716353e2f121785a7d89
GIT binary patch
literal 294912
zc%1FkOKco>836DZ?|L0ObrglPZUshb6=+<HSnp%J7DCi<T^eef)Jf=5vUcsQ<l-ca
z*C8|kEf!#IZ~^rK6$dKd1eZ#jxI&Q-7ams*5eTUghaxqh5oPATaVKs;MO=#T@8_9s
zzWG1C`Ml%D=|>mWw>sr#E^MA_ZIx@$SE4wM9w?WiC>lu5;V4&1&*E+OarEv6qL2M)
zXtZ}TI&kIb=u3xszqtC!)$OaFy7I=Ar?33#KiCfd0000000000000000000000000
z0000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000000000001BKNu<$hwo0WBk39UZbs<=000000000000000
z000000000000000000000002{QlStHkEGYQcQZ;40000000000000000000000000
z00000000000002kmkNbwcqF~Xy&F+_00000000000000000000000000000000000
z0002M{!=O(8Gb2xawJXT-m6i1000000000000000000000000000000000000002M
zzVN=n)bRDaL-A-9dOwWP0{{R300000000000000000000000000000000000{?|Pg
z4~|c5N6)po-OCp?*IxZWeE8X)Tzl~ozkKa`_kL$%ywa?EsC4lDoriZ`AC2!Aj0=@J
zi-(&RUpvs5{OcQ^{KLy<FIMmS>OdS956?AkJTm)A?KhwM>9vD5KJdcnk+gW+`&*PA
y0000000000000000000000000000000000000026uN*9l4?oxHb}wJpT>B^B%kLoo
--- a/toolkit/components/passwordmgr/test/unit/head.js
+++ b/toolkit/components/passwordmgr/test/unit/head.js
@@ -3,16 +3,17 @@
  */
 
 "use strict";
 
 // Globals
 
 let { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
+Cu.import("resource://gre/modules/AppConstants.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/LoginRecipes.jsm");
 Cu.import("resource://gre/modules/LoginHelper.jsm");
 Cu.import("resource://testing-common/MockDocument.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
                                   "resource://gre/modules/DownloadPaths.jsm");
@@ -96,18 +97,22 @@ const RecipeHelpers = {
 
 // Initialization functions common to all tests
 
 add_task(async function test_common_initialize()
 {
   // Before initializing the service for the first time, we should copy the key
   // file required to decrypt the logins contained in the SQLite databases used
   // by migration tests.  This file is not required for the other tests.
-  await OS.File.copy(do_get_file("data/key3.db").path,
-                     OS.Path.join(OS.Constants.Path.profileDir, "key3.db"));
+
+
+  const isAndroid = AppConstants.platform == "android";
+  const keyDBName = isAndroid ? "key4.db" : "key3.db";
+  await OS.File.copy(do_get_file(`data/${keyDBName}`).path,
+                     OS.Path.join(OS.Constants.Path.profileDir, keyDBName));
 
   // Ensure that the service and the storage module are initialized.
   await Services.logins.initializationPromise;
 
   // Ensure that every test file starts with an empty database.
   LoginTestUtils.clearData();
 
   // Clean up after every test.
--- a/toolkit/components/passwordmgr/test/unit/xpcshell.ini
+++ b/toolkit/components/passwordmgr/test/unit/xpcshell.ini
@@ -7,17 +7,17 @@ support-files = data/**
 skip-if = os == "android"
 [test_module_LoginStore.js]
 skip-if = os == "android"
 [test_removeLegacySignonFiles.js]
 skip-if = os == "android"
 
 # Test SQLite database backup and migration, applicable to Android only.
 [test_storage_mozStorage.js]
-skip-if = true || os != "android" # Bug 1171687: Needs fixing on Android
+skip-if = os != "android"
 
 # The following tests apply to any storage back-end.
 [test_context_menu.js]
 skip-if = os == "android" # The context menu isn't used on Android.
 # LoginManagerContextMenu is only included for MOZ_BUILD_APP == 'browser'.
 run-if = buildapp == "browser"
 [test_dedupeLogins.js]
 [test_disabled_hosts.js]