Bug 619236 - Set user_version in generated permissions.sqlite for tests. r=sicking
authorMounir Lamouri <mounir.lamouri@gmail.com>
Thu, 23 Aug 2012 11:39:41 -0700
changeset 105528 4e1840fca4f3070193405a12c0a9f4af7d91d37f
parent 105527 5e035bffbad5ea7ed6b1a0a962c38ebe925cbd22
child 105529 9435261f7808c2d214e14ad8e97a255cee5a4ed6
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewerssicking
bugs619236
milestone17.0a1
Bug 619236 - Set user_version in generated permissions.sqlite for tests. r=sicking
build/automation.py.in
testing/mozbase/mozprofile/mozprofile/permissions.py
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -259,16 +259,19 @@ class Automation(object):
       raise SyntaxError(lineno + 1, "missing primary location")
 
     return locations
 
   def setupPermissionsDatabase(self, profileDir, permissions):
     # Open database and create table
     permDB = sqlite3.connect(os.path.join(profileDir, "permissions.sqlite"))
     cursor = permDB.cursor();
+
+    cursor.execute("PRAGMA user_version=3");
+
     # SQL copied from nsPermissionManager.cpp
     cursor.execute("""CREATE TABLE moz_hosts (
        id INTEGER PRIMARY KEY,
        host TEXT,
        type TEXT,
        permission INTEGER,
        expireType INTEGER,
        expireTime INTEGER,
--- a/testing/mozbase/mozprofile/mozprofile/permissions.py
+++ b/testing/mozbase/mozprofile/mozprofile/permissions.py
@@ -226,16 +226,19 @@ class Permissions(object):
                 self._locations.read(locations)
 
     def write_db(self, locations):
         """write permissions to the sqlite database"""
 
         # Open database and create table
         permDB = sqlite3.connect(os.path.join(self._profileDir, "permissions.sqlite"))
         cursor = permDB.cursor();
+
+        cursor.execute("PRAGMA user_version=3");
+
         # SQL copied from
         # http://mxr.mozilla.org/mozilla-central/source/extensions/cookie/nsPermissionManager.cpp
         cursor.execute("""CREATE TABLE IF NOT EXISTS moz_hosts (
            id INTEGER PRIMARY KEY,
            host TEXT,
            type TEXT,
            permission INTEGER,
            expireType INTEGER,