OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 sql::Statement s2(connection.GetUniqueStatement(stmt.c_str())); | 601 sql::Statement s2(connection.GetUniqueStatement(stmt.c_str())); |
602 ASSERT_TRUE(s2.Step()); | 602 ASSERT_TRUE(s2.Step()); |
603 EXPECT_EQ(2, s2.ColumnInt(0)); | 603 EXPECT_EQ(2, s2.ColumnInt(0)); |
604 EXPECT_EQ("Google", s2.ColumnString(1)); | 604 EXPECT_EQ("Google", s2.ColumnString(1)); |
605 EXPECT_EQ("google.com", s2.ColumnString(2)); | 605 EXPECT_EQ("google.com", s2.ColumnString(2)); |
606 EXPECT_EQ("http://www.google.com/favicon.ico", s2.ColumnString(3)); | 606 EXPECT_EQ("http://www.google.com/favicon.ico", s2.ColumnString(3)); |
607 EXPECT_EQ("{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}"\ | 607 EXPECT_EQ("{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}"\ |
608 "{google:originalQueryForSuggestion}sourceid=chrome&ie={inputEncoding}"\ | 608 "{google:originalQueryForSuggestion}sourceid=chrome&ie={inputEncoding}"\ |
609 "&q={searchTerms}", | 609 "&q={searchTerms}", |
610 s2.ColumnString(4)); | 610 s2.ColumnString(4)); |
611 EXPECT_EQ(true, s2.ColumnBool(5)); | 611 EXPECT_TRUE(s2.ColumnBool(5)); |
612 EXPECT_EQ(std::string(), s2.ColumnString(6)); | 612 EXPECT_EQ(std::string(), s2.ColumnString(6)); |
613 EXPECT_EQ(0, s2.ColumnInt(7)); | 613 EXPECT_EQ(0, s2.ColumnInt(7)); |
614 EXPECT_EQ(0, s2.ColumnInt(8)); | 614 EXPECT_EQ(0, s2.ColumnInt(8)); |
615 EXPECT_EQ(std::string("UTF-8"), s2.ColumnString(9)); | 615 EXPECT_EQ(std::string("UTF-8"), s2.ColumnString(9)); |
616 EXPECT_EQ(true, s2.ColumnBool(10)); | 616 EXPECT_TRUE(s2.ColumnBool(10)); |
617 EXPECT_EQ(std::string("{google:baseSuggestURL}search?client=chrome&hl=" | 617 EXPECT_EQ(std::string("{google:baseSuggestURL}search?client=chrome&hl=" |
618 "{language}&q={searchTerms}"), s2.ColumnString(11)); | 618 "{language}&q={searchTerms}"), s2.ColumnString(11)); |
619 EXPECT_EQ(1, s2.ColumnInt(12)); | 619 EXPECT_EQ(1, s2.ColumnInt(12)); |
620 EXPECT_EQ(true, s2.ColumnBool(13)); | 620 EXPECT_TRUE(s2.ColumnBool(13)); |
621 EXPECT_EQ(6245, s2.ColumnInt(14)); | 621 EXPECT_EQ(6245, s2.ColumnInt(14)); |
622 EXPECT_EQ(false, s2.ColumnBool(15)); | 622 EXPECT_FALSE(s2.ColumnBool(15)); |
623 EXPECT_EQ(std::string(), s2.ColumnString(16)); | 623 EXPECT_EQ(std::string(), s2.ColumnString(16)); |
624 } | 624 } |
625 } | 625 } |
626 | 626 |
627 // Makes sure date_modified is added correctly to autofill_profiles and | 627 // Makes sure date_modified is added correctly to autofill_profiles and |
628 // credit_cards. | 628 // credit_cards. |
629 TEST_F(WebDatabaseMigrationTest, MigrateVersion29ToCurrent) { | 629 TEST_F(WebDatabaseMigrationTest, MigrateVersion29ToCurrent) { |
630 // Initialize the database. | 630 // Initialize the database. |
631 ASSERT_NO_FATAL_FAILURE(LoadDatabase(FILE_PATH_LITERAL("version_29.sql"))); | 631 ASSERT_NO_FATAL_FAILURE(LoadDatabase(FILE_PATH_LITERAL("version_29.sql"))); |
632 | 632 |
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1826 sql::Statement s(connection.GetUniqueStatement(query.c_str())); | 1826 sql::Statement s(connection.GetUniqueStatement(query.c_str())); |
1827 ASSERT_TRUE(s.Step()); | 1827 ASSERT_TRUE(s.Step()); |
1828 EXPECT_EQ(2, s.ColumnInt(0)); | 1828 EXPECT_EQ(2, s.ColumnInt(0)); |
1829 EXPECT_EQ("Google", s.ColumnString(1)); | 1829 EXPECT_EQ("Google", s.ColumnString(1)); |
1830 EXPECT_EQ("google.com", s.ColumnString(2)); | 1830 EXPECT_EQ("google.com", s.ColumnString(2)); |
1831 EXPECT_EQ("http://www.google.com/favicon.ico", s.ColumnString(3)); | 1831 EXPECT_EQ("http://www.google.com/favicon.ico", s.ColumnString(3)); |
1832 EXPECT_EQ("{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}" | 1832 EXPECT_EQ("{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}" |
1833 "{google:originalQueryForSuggestion}sourceid=chrome&" | 1833 "{google:originalQueryForSuggestion}sourceid=chrome&" |
1834 "ie={inputEncoding}&q={searchTerms}", | 1834 "ie={inputEncoding}&q={searchTerms}", |
1835 s.ColumnString(4)); | 1835 s.ColumnString(4)); |
1836 EXPECT_EQ(true, s.ColumnBool(5)); | 1836 EXPECT_TRUE(s.ColumnBool(5)); |
1837 EXPECT_EQ(std::string(), s.ColumnString(6)); | 1837 EXPECT_EQ(std::string(), s.ColumnString(6)); |
1838 EXPECT_EQ(0, s.ColumnInt(7)); | 1838 EXPECT_EQ(0, s.ColumnInt(7)); |
1839 EXPECT_EQ(0, s.ColumnInt(8)); | 1839 EXPECT_EQ(0, s.ColumnInt(8)); |
1840 EXPECT_EQ("UTF-8", s.ColumnString(9)); | 1840 EXPECT_EQ("UTF-8", s.ColumnString(9)); |
1841 EXPECT_EQ(true, s.ColumnBool(10)); | 1841 EXPECT_TRUE(s.ColumnBool(10)); |
1842 EXPECT_EQ("{google:baseSuggestURL}search?client=chrome&hl={language}&" | 1842 EXPECT_EQ("{google:baseSuggestURL}search?client=chrome&hl={language}&" |
1843 "q={searchTerms}", s.ColumnString(11)); | 1843 "q={searchTerms}", s.ColumnString(11)); |
1844 EXPECT_EQ(1, s.ColumnInt(12)); | 1844 EXPECT_EQ(1, s.ColumnInt(12)); |
1845 EXPECT_EQ(true, s.ColumnBool(13)); | 1845 EXPECT_TRUE(s.ColumnBool(13)); |
1846 EXPECT_EQ(6262, s.ColumnInt(14)); | 1846 EXPECT_EQ(6262, s.ColumnInt(14)); |
1847 EXPECT_EQ(false, s.ColumnBool(15)); | 1847 EXPECT_FALSE(s.ColumnBool(15)); |
1848 EXPECT_EQ("{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&" | 1848 EXPECT_EQ("{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&" |
1849 "ie={inputEncoding}&ion=1{searchTerms}&nord=1", | 1849 "ie={inputEncoding}&ion=1{searchTerms}&nord=1", |
1850 s.ColumnString(16)); | 1850 s.ColumnString(16)); |
1851 EXPECT_EQ(0, s.ColumnInt(17)); | 1851 EXPECT_EQ(0, s.ColumnInt(17)); |
1852 EXPECT_EQ("{1234-5678-90AB-CDEF}", s.ColumnString(18)); | 1852 EXPECT_EQ("{1234-5678-90AB-CDEF}", s.ColumnString(18)); |
1853 | 1853 |
1854 EXPECT_FALSE(s.Step()); | 1854 EXPECT_FALSE(s.Step()); |
1855 } | 1855 } |
1856 } | 1856 } |
1857 | 1857 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 &default_search_provider_id_backup)); | 1926 &default_search_provider_id_backup)); |
1927 // Backup ID must be updated to match the old default search provider ID. | 1927 // Backup ID must be updated to match the old default search provider ID. |
1928 EXPECT_EQ(default_search_provider_id, default_search_provider_id_backup); | 1928 EXPECT_EQ(default_search_provider_id, default_search_provider_id_backup); |
1929 | 1929 |
1930 std::string default_search_provider_id_backup_signature; | 1930 std::string default_search_provider_id_backup_signature; |
1931 EXPECT_TRUE(meta_table.GetValue(KeywordTable::kBackupSignatureKey, | 1931 EXPECT_TRUE(meta_table.GetValue(KeywordTable::kBackupSignatureKey, |
1932 &default_search_provider_id_backup_signature)); | 1932 &default_search_provider_id_backup_signature)); |
1933 EXPECT_FALSE(default_search_provider_id_backup_signature.empty()); | 1933 EXPECT_FALSE(default_search_provider_id_backup_signature.empty()); |
1934 } | 1934 } |
1935 } | 1935 } |
OLD | NEW |