diff options
author | Andras Becsi <andras.becsi@digia.com> | 2013-12-11 21:33:03 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2013-12-13 12:34:07 +0100 |
commit | f2a33ff9cbc6d19943f1c7fbddd1f23d23975577 (patch) | |
tree | 0586a32aa390ade8557dfd6b4897f43a07449578 /chromium/components/webdata/common | |
parent | 5362912cdb5eea702b68ebe23702468d17c3017a (diff) | |
download | qtwebengine-chromium-f2a33ff9cbc6d19943f1c7fbddd1f23d23975577.tar.gz |
Update Chromium to branch 1650 (31.0.1650.63)
Change-Id: I57d8c832eaec1eb2364e0a8e7352a6dd354db99f
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'chromium/components/webdata/common')
-rw-r--r-- | chromium/components/webdata/common/web_database.cc | 2 | ||||
-rw-r--r-- | chromium/components/webdata/common/web_database_migration_unittest.cc | 45 |
2 files changed, 42 insertions, 5 deletions
diff --git a/chromium/components/webdata/common/web_database.cc b/chromium/components/webdata/common/web_database.cc index e4e44ef1e03..161fb80bae4 100644 --- a/chromium/components/webdata/common/web_database.cc +++ b/chromium/components/webdata/common/web_database.cc @@ -14,7 +14,7 @@ // corresponding changes must happen in the unit tests, and new migration test // added. See |WebDatabaseMigrationTest::kCurrentTestedVersionNumber|. // static -const int WebDatabase::kCurrentVersionNumber = 52; +const int WebDatabase::kCurrentVersionNumber = 53; namespace { diff --git a/chromium/components/webdata/common/web_database_migration_unittest.cc b/chromium/components/webdata/common/web_database_migration_unittest.cc index 5e6ef6e9dc3..57ef02dc175 100644 --- a/chromium/components/webdata/common/web_database_migration_unittest.cc +++ b/chromium/components/webdata/common/web_database_migration_unittest.cc @@ -220,7 +220,7 @@ class WebDatabaseMigrationTest : public testing::Test { source_path = source_path.AppendASCII("web_database"); source_path = source_path.Append(file); return base::PathExists(source_path) && - file_util::ReadFileToString(source_path, contents); + base::ReadFileToString(source_path, contents); } static int VersionFromConnection(sql::Connection* connection) { @@ -247,7 +247,7 @@ class WebDatabaseMigrationTest : public testing::Test { DISALLOW_COPY_AND_ASSIGN(WebDatabaseMigrationTest); }; -const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 52; +const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 53; void WebDatabaseMigrationTest::LoadDatabase( const base::FilePath::StringType& file) { @@ -2029,8 +2029,9 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion49ToCurrent) { } // Tests that the columns |image_url|, |search_url_post_params|, -// |suggest_url_post_params|, |instant_url_post_params|, |image_url_post_params| -// are added to the keyword table schema for a version 52 database. +// |suggest_url_post_params|, |instant_url_post_params|, and +// |image_url_post_params| are added to the keyword table schema for a version +// 50 database. TEST_F(WebDatabaseMigrationTest, MigrateVersion50ToCurrent) { ASSERT_NO_FATAL_FAILURE( LoadDatabase(FILE_PATH_LITERAL("version_50.sql"))); @@ -2080,3 +2081,39 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion50ToCurrent) { "image_url_post_params")); } } + +// Tests that the column |new_tab_url| is added to the keyword table schema for +// a version 52 database. +TEST_F(WebDatabaseMigrationTest, MigrateVersion52ToCurrent) { + ASSERT_NO_FATAL_FAILURE( + LoadDatabase(FILE_PATH_LITERAL("version_52.sql"))); + + // Verify pre-conditions. These are expectations for version 52 of the + // database. + { + sql::Connection connection; + ASSERT_TRUE(connection.Open(GetDatabasePath())); + ASSERT_TRUE(sql::MetaTable::DoesTableExist(&connection)); + + sql::MetaTable meta_table; + ASSERT_TRUE(meta_table.Init(&connection, 52, 52)); + + ASSERT_FALSE(connection.DoesColumnExist("keywords", "new_tab_url")); + } + + DoMigration(); + + // Verify post-conditions. These are expectations for current version of the + // database. + { + sql::Connection connection; + ASSERT_TRUE(connection.Open(GetDatabasePath())); + ASSERT_TRUE(sql::MetaTable::DoesTableExist(&connection)); + + // Check version. + EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); + + // New columns should have been created. + EXPECT_TRUE(connection.DoesColumnExist("keywords", "new_tab_url")); + } +} |