Bug 735912 - Update tests for new behavior. r=mfinkle
authorWes Johnston <wjohnston@mozilla.com>
Fri, 30 Mar 2012 11:01:45 -0700
changeset 90757 af9989ded605ad39a5c664ea824e5a5581be93c3
parent 90756 56d86fb6b887dbf95c234560c7bce1b81277fa90
child 90758 bb53aec4a302aa1d4dd170eae5d9a29eda2cd662
push id22382
push userbmo@edmorley.co.uk
push dateSat, 31 Mar 2012 21:44:34 +0000
treeherdermozilla-central@bbe5086163c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs735912
milestone14.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 735912 - Update tests for new behavior. r=mfinkle
mobile/android/base/tests/testFormHistory.java.in
mobile/android/base/tests/testPasswordEncrypt.java.in
mobile/android/base/tests/testPasswordProvider.java.in
mobile/android/chrome/content/browser.js
--- a/mobile/android/base/tests/testFormHistory.java.in
+++ b/mobile/android/base/tests/testFormHistory.java.in
@@ -50,25 +50,18 @@ public class testFormHistory extends Bas
             return;
         } catch(NoSuchFieldException ex) {
             mAsserter.is(false, true, "Error getting field");
             return;
         } catch(IllegalAccessException ex) {
             mAsserter.is(false, true, "Error using field");
             return;
         }
-  
-        // Trying to insert should fail the first time round because there is no form history database
-        // Wait for gecko to reply and then we'll try again
-        contentEventExpecter = mActions.expectGeckoEvent("FormHistory:Init:Return");
+
         Uri uri = cr.insert(formHistoryUri, cvs[0]);
-        mAsserter.is(uri, null, "Insert returned null correctly");
-        contentEventExpecter.blockForEvent();
-  
-        uri = cr.insert(formHistoryUri, cvs[0]);
         Uri expectedUri = formHistoryUri.buildUpon().appendPath("1").build();
         mAsserter.is(expectedUri.toString(), uri.toString(), "Insert returned correct uri");
         SqliteCompare(DB_NAME, "SELECT * FROM moz_formhistory", cvs);
   
         cvs[0].put("fieldname", "fieldname2");
   
         int numUpdated = cr.update(formHistoryUri, cvs[0], null, null);
         mAsserter.is(1, numUpdated, "Correct number updated");
--- a/mobile/android/base/tests/testPasswordEncrypt.java.in
+++ b/mobile/android/base/tests/testPasswordEncrypt.java.in
@@ -41,24 +41,17 @@ public class testPasswordEncrypt extends
           cvs.put("encryptedUsername", "username");
           cvs.put("encryptedPassword", "password");
 
           // Attempt to insert into the db
           passwordUri = (Uri)pwds.getField("CONTENT_URI").get(null);
           Uri.Builder builder = passwordUri.buildUpon();
           passwordUri = builder.appendQueryParameter("profilePath", mProfile).build();
 
-          // This should fail the first time round because there is no pw database
-          // Wait for gecko to reply and then we'll try again
-          contentEventExpecter = mActions.expectGeckoEvent("Passwords:Init:Return");
           Uri uri = cr.insert(passwordUri, cvs);
-          contentEventExpecter.blockForEvent();
-          mAsserter.is(uri, null, "Insert returned null correctly");
-  
-          uri = cr.insert(passwordUri, cvs);
           Uri expectedUri = passwordUri.buildUpon().appendPath("1").build();
           mAsserter.is(uri.toString(), expectedUri.toString(), "Insert returned correct uri");
 
           Cursor list = mActions.querySql(dbPath, "SELECT encryptedUsername FROM moz_logins");
           String resourcePath = getActivity().getApplication().getPackageResourcePath();
           loadNSSLibs.invoke(null, (Context)getActivity(), resourcePath);
 
           list.moveToFirst();
--- a/mobile/android/base/tests/testPasswordProvider.java.in
+++ b/mobile/android/base/tests/testPasswordProvider.java.in
@@ -52,24 +52,18 @@ public class testPasswordProvider extend
             return;
         } catch(NoSuchFieldException ex) {
             mAsserter.is(false, true, "Error getting field");
             return;
         } catch(IllegalAccessException ex) {
             mAsserter.is(false, true, "Error using field");
             return;
         }
-        // Trying to inset should fail the first time round because there is no pw database
-        // Wait for gecko to reply and then we'll try again
-        contentEventExpecter = mActions.expectGeckoEvent("Passwords:Init:Return");
+
         Uri uri = cr.insert(passwordUri, cvs[0]);
-        mAsserter.is(uri, null, "Insert returned null correctly");
-        contentEventExpecter.blockForEvent();
-  
-        uri = cr.insert(passwordUri, cvs[0]);
         Uri expectedUri = passwordUri.buildUpon().appendPath("1").build();
         mAsserter.is(uri.toString(), expectedUri.toString(), "Insert returned correct uri");
         Cursor c = cr.query(passwordUri, null, null, null, null);
         SqliteCompare(c, cvs);
   
         cvs[0].put("usernameField", "usernameField2");
         cvs[0].put("passwordField", "passwordField2");
   
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -308,33 +308,33 @@ var BrowserApp = {
       ss.restoreLastSession(restoreToFront, forceRestore);
     } else {
       this.addTab(url, { showProgress: url != "about:home" });
 
       // show telemetry door hanger if we aren't restoring a session
       this._showTelemetryPrompt();
     }
 
+    if (this.isAppUpdated())
+      this.onAppUpdated();
+
     // notify java that gecko has loaded
     sendMessageToJava({
       gecko: {
         type: "Gecko:Ready"
       }
     });
 
     // after gecko has loaded, set the checkerboarding pref once at startup (for testing only)
     sendMessageToJava({
       gecko: {
         "type": "Checkerboard:Toggle",
         "value": Services.prefs.getBoolPref("gfx.show_checkerboard_pattern")
       }
     });
-
-    if (this.isAppUpdated())
-      this.onAppUpdated();
   },
 
   isAppUpdated: function() {
     let savedmstone = null;
     try {
       savedmstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone");
     } catch (e) {
     }