Bug 718817 - Tests for deleted passwords database migration. r=dolske
authorWes Johnston <wjohnston@mozilla.com>
Thu, 09 Feb 2012 09:56:03 -0800
changeset 86513 8fa903fa888740143d0537fb51abca5061c6e01e
parent 86512 7a74c7738877595588ffb089efcb524a150342eb
child 86514 85346ae0ea9942f1ac9cff829f2f588fd8deff19
push id5899
push userwjohnston@mozilla.com
push dateThu, 09 Feb 2012 17:56:39 +0000
treeherdermozilla-inbound@85346ae0ea99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske
bugs718817
milestone13.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 718817 - Tests for deleted passwords database migration. r=dolske
toolkit/components/passwordmgr/test/unit/data/signons-v4.sqlite
toolkit/components/passwordmgr/test/unit/data/signons-v4v5.sqlite
toolkit/components/passwordmgr/test/unit/test_storage_mozStorage_migrate.js
new file mode 100644
index 0000000000000000000000000000000000000000..227c09c816b9a36c4df6aff86a9937acd7a4e599
GIT binary patch
literal 294912
zc%1Fs&2HmV7zSWxrfu3tU9cenHZB_)sc3{|!3qr}WS}CXoiveV#3IT}OdHW8rEvwF
zKc%o>!3DA4GPnb-1iQZ(Ct+A1dGkDykL+_kpYtBe@izO9>iswhzaO0px^Z|vm;{AF
z@Oc;pL9m(}Yr(Bzax6_<7c$rLtOg(d{o(rScZ1dEe+IALfA!I;zh3_F@`D$@zt~JV
z00000000000000000000000000000000000008(u{jgdrf3{ILU+xck(a(d?^Ul%e
zpg$aUqT#dF*>Tj#^siN$we40d+-ZDSdmJvR4|f|=W1ClFm2PpR{OLyFEW6ghX}_0U
zXm!y-x5b%N(t*nP`bx39pKR!Uc9Fx;I39KfQRgs@kDF2VXpmj9xM;~mw`Kxdmu-bN
zb(Qn?mW$=@l04OgdD6cP-#>ji=*R75J)3Fet(oTBzA)DtwUyygvHT#3wze=@W?=cP
zVg7CT%6a8Zv3&1d;g>?(eR>q7CB6PQJ?(v+)Qo33?q03e+Ww+m3ulJI&3-S;+G(_E
zU)7r7UUTQ$?dFs4o7$7D>jYC}t=i*O*lz4RYS+@Z)!oL!`cAbKHfwwJ?P{&EeRrkY
zzE=n?HZ=b6s2@k2?rA)_xbDnE>3lNNmHw;y(yz}7#q!2R;kS2gwtV?iZqM$_Z1S>y
z?(Y8U_Ad9=*iDXhy}otxK4vPm-gqIV2TsS)Njm4lest8EJLhqCJpO5P(py}S{OnK8
zj^n7;zM5=t#opCqGZpENI{OSR0$zPn<~^LPxIc)hCs8+<c<xxeJC2h~y?JBTNven4
z;XzU|JvN@c>Gr<Ldio`u<oh8900000000000000000000000000000000000004lz
zt*6Z-=MVq@000000000000000000000000000000000000Fbj%+Dvi|0RR9100000
z000000000000000000000000000000IV+{jB<BzS0000000000000000000000000
z0000000000005A)Qrb*%4gmlF00000000000000000000000000000000000068nA
z%_Qd#000000000000000000000000000000000000001xvr^hjat;9i0000000000
z00000000000000000000000000022FrOhPg5C8xG0000000000000000000000000
P0000000000kh6aPLG#X~
new file mode 100644
index 0000000000000000000000000000000000000000..4534cf255332b380f45efcd5519c4eed8cb3bc69
GIT binary patch
literal 327680
zc%1FsPj4b+90zdNZA&5P!HYz_Oubl=nx@%<C!>{RwGnBTLb4kVgk8p#2&I;3wB0|U
z>%oIB$b&D#ci=0LX=%$2;KtK<_<WLi!p!rV=lMPj&(k9ZkE`7%41O4#_S;eLAT!Ej
zvzaf0Ad|@yCfAMC@wGH{pH1A)Q^<V!_s46m-_PVP@|o8kzWU_VUoZc7`O%BtUu<0b
zIer8H00000000000000000000000000000000000@c(tWmCqHox3h2ZQTtgh><=zl
zov;^1VW-s_9CnX~vrh`;dS$0k2^u?JRV%@4f3VT*1T%JPjmp=Rdaz&L{cflJH2Aji
zbo20Rwz5%q(%6i;{qW)SpveJBKd$DApRZ>xm%GQE@RxY{>uFoz@$<&{N!Us}&rjm+
z)*e=#1dHl}z1mdY#-y**&aD(bThE>+=ZcdjCt6)J(Oq$3mbjyIxweuk9*h_CAUVm=
zU>F^@`(f)SicacbyVp-nnOijFqE{0EZpt=;+q%-_2g|wQ_v1X}g?Zwi4L>-0*6&8m
zdNrA8<(--4yuL8kTeYR*rCjlgakTuxXo-&HcZT`5=}VWTd%5D)R`yNyZg+Ht@yE_L
z<C@{jgZs04W4e3p)|j_5ZW1ImM$oM7K5kaxxaGatqv~$C5!5UD)tz#sv~z!@*xbry
zt`;=>sn?CdR{Ja(T-~>3qO`VW9>u@vzVz$!Y_7Pzp8f5;+a=!}1lOPL%`Ec2Zu~jR
zyIx;yZ+tbY)y>=QWAbQt>kBd6aW)K3<1rs~!(M0Zm?!Pw@aMs4XK}@N+n=7Fj8C2B
zWU$2*`;)<DDi$7UlQU)BALr`8E1!n#IS1ZVU$s4q#+f?v`fiexkJ`tF<C5vV;q*&W
zhv-^-_K(v2*8>0m000000000000000000000000000000000000BKu`n^DRk00000
z0000000000000000000000000000000000WWresIr5pkP00000000000000000000
z000000000000000002@}h?`N$ApigX00000000000000000000000000000000000
zAZ3NP8KoQo000000000000000000000000000000000000000|R*0KX${_#%00000
z00000000000000000000000000000003c<BxEZA!0ssI200000000000000000000
z000000000000000QdWqYQOY3z00000000000000000000000000000000000001Cm
rYjHD5IRpRz000000000000000000000000000000000000Ho|6DV73c
--- a/toolkit/components/passwordmgr/test/unit/test_storage_mozStorage_migrate.js
+++ b/toolkit/components/passwordmgr/test/unit/test_storage_mozStorage_migrate.js
@@ -9,17 +9,17 @@
 
 
 const STORAGE_TYPE = "mozStorage";
 const ENCTYPE_BASE64 = 0;
 const ENCTYPE_SDR = 1;
 
 // Current schema version used by storage-mozStorage.js. This will need to be
 // kept in sync with the version there (or else the tests fail).
-const CURRENT_SCHEMA = 4;
+const CURRENT_SCHEMA = 5;
 
 function run_test() {
 
 try {
 
 var isGUID = /^\{[0-9a-f\d]{8}-[0-9a-f\d]{4}-[0-9a-f\d]{4}-[0-9a-f\d]{4}-[0-9a-f\d]{12}\}$/;
 function getGUIDforID(conn, id) {
     var stmt = conn.createStatement("SELECT guid from moz_logins WHERE id = " + id);
@@ -289,12 +289,43 @@ do_check_eq(1262049951275, t1.timeCreate
 do_check_eq(1262049951275, t1.timeLastUsed);
 do_check_eq(1262049951275, t1.timePasswordChanged);
 
 do_check_eq(1, t2.timesUsed);
 do_check_true(LoginTest.is_about_now(t2.timeCreated));
 do_check_true(LoginTest.is_about_now(t2.timeLastUsed));
 do_check_true(LoginTest.is_about_now(t2.timePasswordChanged));
 
+
+/* ========== 9 ========== */
+testnum++;
+testdesc = "Test upgrade from v4 storage"
+
+LoginTest.copyFile("signons-v4.sqlite");
+// Sanity check the test file.
+dbConnection = LoginTest.openDB("signons-v4.sqlite");
+do_check_eq(4, dbConnection.schemaVersion);
+do_check_false(dbConnection.tableExists("moz_deleted_logins"));
+
+storage = LoginTest.reloadStorage(OUTDIR, "signons-v4.sqlite");
+do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
+do_check_true(dbConnection.tableExists("moz_deleted_logins"));
+
+
+/* ========== 10 ========== */
+testnum++;
+testdesc = "Test upgrade from v4->v5->v4 storage"
+
+LoginTest.copyFile("signons-v4v5.sqlite");
+// Sanity check the test file.
+dbConnection = LoginTest.openDB("signons-v4v5.sqlite");
+do_check_eq(4, dbConnection.schemaVersion);
+do_check_true(dbConnection.tableExists("moz_deleted_logins"));
+
+storage = LoginTest.reloadStorage(OUTDIR, "signons-v4v5.sqlite");
+do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
+do_check_true(dbConnection.tableExists("moz_deleted_logins"));
+
+
 } catch (e) {
     throw "FAILED in test #" + testnum + " -- " + testdesc + ": " + e;
 }
 };