Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: chrome/browser/webdata/web_database_migration_unittest.cc

Issue 9706012: Add abstractions that let embedders drive tests of WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove CONTENT_EXPORT on statically linked functions. Merge to head for commit. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_EQ(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_EQ(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 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_EQ(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_EQ(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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/web_ui_unittest.cc ('k') | chrome/test/base/chrome_render_view_host_test_harness.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698