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

Side by Side Diff: components/history/core/browser/history_backend_db_unittest.cc

Issue 2720613002: Downloads: Added transient flag to download item and download database (Closed)
Patch Set: Fixed migration unit test Created 3 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
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 // History unit tests come in two flavors: 5 // History unit tests come in two flavors:
6 // 6 //
7 // 1. The more complicated style is that the unit test creates a full history 7 // 1. The more complicated style is that the unit test creates a full history
8 // service. This spawns a background thread for the history backend, and 8 // service. This spawns a background thread for the history backend, and
9 // all communication is asynchronous. This is useful for testing more 9 // all communication is asynchronous. This is useful for testing more
10 // complicated things or end-to-end behavior. 10 // complicated things or end-to-end behavior.
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 "SELECT COUNT(*) from downloads_slices")); 758 "SELECT COUNT(*) from downloads_slices"));
759 EXPECT_TRUE(s1.Step()); 759 EXPECT_TRUE(s1.Step());
760 EXPECT_EQ(0, s1.ColumnInt(0)); 760 EXPECT_EQ(0, s1.ColumnInt(0));
761 const char kInsertStatement[] = "INSERT INTO downloads_slices " 761 const char kInsertStatement[] = "INSERT INTO downloads_slices "
762 "(download_id, offset, received_bytes) VALUES (1, 0, 100)"; 762 "(download_id, offset, received_bytes) VALUES (1, 0, 100)";
763 ASSERT_TRUE(db.Execute(kInsertStatement)); 763 ASSERT_TRUE(db.Execute(kInsertStatement));
764 } 764 }
765 } 765 }
766 } 766 }
767 767
768 // Tests that last access time and visible is automatically added when migrating
769 // to version 35.
770 TEST_F(HistoryBackendDBTest, MigrateDownloadsLastAccessTimeAndVisible) {
771 ASSERT_NO_FATAL_FAILURE(CreateDBVersion(32));
772 {
773 sql::Connection db;
774 ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename)));
775 }
776
777 // Re-open the db using the HistoryDatabase, which should migrate to the
778 // current version.
779 CreateBackendAndDatabase();
780 DeleteBackend();
781 {
782 // Re-open the db for manual manipulation.
783 sql::Connection db;
784 ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename)));
785 // The version should have been updated.
786 int cur_version = HistoryDatabase::GetCurrentVersion();
787 ASSERT_LE(34, cur_version);
David Trainor- moved to gerrit 2017/03/06 18:28:39 Do we want to validate that it's going to 35?
shaktisahu 2017/03/08 06:51:30 Didn't get it. The new version after migration sho
788 {
789 sql::Statement s(db.GetUniqueStatement(
790 "SELECT value FROM meta WHERE key = 'version'"));
791 EXPECT_TRUE(s.Step());
792 EXPECT_EQ(cur_version, s.ColumnInt(0));
793 }
794 {
795 // The downloads table should have last_access_time and visible
796 // initialized to zero and true respectively.
797 sql::Statement s(db.GetUniqueStatement(
798 "SELECT last_access_time, visible from downloads"));
799 EXPECT_TRUE(s.Step());
800 EXPECT_EQ(base::Time(), base::Time::FromInternalValue(s.ColumnInt64(0)));
801 EXPECT_EQ(true, s.ColumnInt(1));
802 }
803 }
804 }
805
768 TEST_F(HistoryBackendDBTest, DownloadCreateAndQuery) { 806 TEST_F(HistoryBackendDBTest, DownloadCreateAndQuery) {
769 CreateBackendAndDatabase(); 807 CreateBackendAndDatabase();
770 808
771 ASSERT_EQ(0u, db_->CountDownloads()); 809 ASSERT_EQ(0u, db_->CountDownloads());
772 810
773 std::vector<GURL> url_chain; 811 std::vector<GURL> url_chain;
774 url_chain.push_back(GURL("http://example.com/a")); 812 url_chain.push_back(GURL("http://example.com/a"));
775 url_chain.push_back(GURL("http://example.com/b")); 813 url_chain.push_back(GURL("http://example.com/b"));
776 url_chain.push_back(GURL("http://example.com/c")); 814 url_chain.push_back(GURL("http://example.com/c"));
777 815
778 base::Time start_time(base::Time::Now()); 816 base::Time start_time(base::Time::Now());
779 base::Time end_time(start_time + base::TimeDelta::FromHours(1)); 817 base::Time end_time(start_time + base::TimeDelta::FromHours(1));
780 base::Time last_access_time; 818 base::Time last_access_time;
781 819
782 DownloadRow download_A( 820 DownloadRow download_A(
783 base::FilePath(FILE_PATH_LITERAL("/path/1")), 821 base::FilePath(FILE_PATH_LITERAL("/path/1")),
784 base::FilePath(FILE_PATH_LITERAL("/path/2")), url_chain, 822 base::FilePath(FILE_PATH_LITERAL("/path/2")), url_chain,
785 GURL("http://example.com/referrer"), GURL("http://example.com"), 823 GURL("http://example.com/referrer"), GURL("http://example.com"),
786 GURL("http://example.com/tab-url"), 824 GURL("http://example.com/tab-url"),
787 GURL("http://example.com/tab-referrer"), "GET", "mime/type", 825 GURL("http://example.com/tab-referrer"), "GET", "mime/type",
788 "original/mime-type", start_time, end_time, "etag1", "last_modified_1", 826 "original/mime-type", start_time, end_time, "etag1", "last_modified_1",
789 100, 1000, DownloadState::INTERRUPTED, DownloadDangerType::NOT_DANGEROUS, 827 100, 1000, DownloadState::INTERRUPTED, DownloadDangerType::NOT_DANGEROUS,
790 kTestDownloadInterruptReasonCrash, "hash-value1", 1, 828 kTestDownloadInterruptReasonCrash, "hash-value1", 1,
791 "FE672168-26EF-4275-A149-FEC25F6A75F9", false, last_access_time, 829 "FE672168-26EF-4275-A149-FEC25F6A75F9", false, last_access_time, true,
792 "extension-id", "extension-name", std::vector<DownloadSliceInfo>()); 830 "extension-id", "extension-name", std::vector<DownloadSliceInfo>());
793 ASSERT_TRUE(db_->CreateDownload(download_A)); 831 ASSERT_TRUE(db_->CreateDownload(download_A));
794 832
795 url_chain.push_back(GURL("http://example.com/d")); 833 url_chain.push_back(GURL("http://example.com/d"));
796 834
797 base::Time start_time2(start_time + base::TimeDelta::FromHours(10)); 835 base::Time start_time2(start_time + base::TimeDelta::FromHours(10));
798 base::Time end_time2(end_time + base::TimeDelta::FromHours(10)); 836 base::Time end_time2(end_time + base::TimeDelta::FromHours(10));
799 base::Time last_access_time2(start_time2 + base::TimeDelta::FromHours(5)); 837 base::Time last_access_time2(start_time2 + base::TimeDelta::FromHours(5));
800 838
801 DownloadRow download_B( 839 DownloadRow download_B(
802 base::FilePath(FILE_PATH_LITERAL("/path/3")), 840 base::FilePath(FILE_PATH_LITERAL("/path/3")),
803 base::FilePath(FILE_PATH_LITERAL("/path/4")), url_chain, 841 base::FilePath(FILE_PATH_LITERAL("/path/4")), url_chain,
804 GURL("http://example.com/referrer2"), GURL("http://2.example.com"), 842 GURL("http://example.com/referrer2"), GURL("http://2.example.com"),
805 GURL("http://example.com/tab-url2"), 843 GURL("http://example.com/tab-url2"),
806 GURL("http://example.com/tab-referrer2"), "POST", "mime/type2", 844 GURL("http://example.com/tab-referrer2"), "POST", "mime/type2",
807 "original/mime-type2", start_time2, end_time2, "etag2", "last_modified_2", 845 "original/mime-type2", start_time2, end_time2, "etag2", "last_modified_2",
808 1001, 1001, DownloadState::COMPLETE, DownloadDangerType::DANGEROUS_FILE, 846 1001, 1001, DownloadState::COMPLETE, DownloadDangerType::DANGEROUS_FILE,
809 kTestDownloadInterruptReasonNone, std::string(), 2, 847 kTestDownloadInterruptReasonNone, std::string(), 2,
810 "b70f3869-7d75-4878-acb4-4caf7026d12b", false, last_access_time2, 848 "b70f3869-7d75-4878-acb4-4caf7026d12b", false, last_access_time2, true,
811 "extension-id", "extension-name", std::vector<DownloadSliceInfo>()); 849 "extension-id", "extension-name", std::vector<DownloadSliceInfo>());
812 ASSERT_TRUE(db_->CreateDownload(download_B)); 850 ASSERT_TRUE(db_->CreateDownload(download_B));
813 851
814 EXPECT_EQ(2u, db_->CountDownloads()); 852 EXPECT_EQ(2u, db_->CountDownloads());
815 853
816 std::vector<DownloadRow> results; 854 std::vector<DownloadRow> results;
817 db_->QueryDownloads(&results); 855 db_->QueryDownloads(&results);
818 856
819 ASSERT_EQ(2u, results.size()); 857 ASSERT_EQ(2u, results.size());
820 858
(...skipping 20 matching lines...) Expand all
841 879
842 DownloadRow download( 880 DownloadRow download(
843 base::FilePath(FILE_PATH_LITERAL("/path/1")), 881 base::FilePath(FILE_PATH_LITERAL("/path/1")),
844 base::FilePath(FILE_PATH_LITERAL("/path/2")), url_chain, 882 base::FilePath(FILE_PATH_LITERAL("/path/2")), url_chain,
845 GURL("http://example.com/referrer"), GURL("http://example.com"), 883 GURL("http://example.com/referrer"), GURL("http://example.com"),
846 GURL("http://example.com/tab-url"), 884 GURL("http://example.com/tab-url"),
847 GURL("http://example.com/tab-referrer"), "GET", "mime/type", 885 GURL("http://example.com/tab-referrer"), "GET", "mime/type",
848 "original/mime-type", start_time, end_time, "etag1", "last_modified_1", 886 "original/mime-type", start_time, end_time, "etag1", "last_modified_1",
849 100, 1000, DownloadState::INTERRUPTED, DownloadDangerType::NOT_DANGEROUS, 887 100, 1000, DownloadState::INTERRUPTED, DownloadDangerType::NOT_DANGEROUS,
850 3, "some-hash-value", 1, "FE672168-26EF-4275-A149-FEC25F6A75F9", false, 888 3, "some-hash-value", 1, "FE672168-26EF-4275-A149-FEC25F6A75F9", false,
851 last_access_time, "extension-id", "extension-name", 889 last_access_time, false, "extension-id", "extension-name",
852 std::vector<DownloadSliceInfo>()); 890 std::vector<DownloadSliceInfo>());
853 db_->CreateDownload(download); 891 db_->CreateDownload(download);
854 892
855 download.current_path = 893 download.current_path =
856 base::FilePath(FILE_PATH_LITERAL("/new/current_path")); 894 base::FilePath(FILE_PATH_LITERAL("/new/current_path"));
857 download.target_path = base::FilePath(FILE_PATH_LITERAL("/new/target_path")); 895 download.target_path = base::FilePath(FILE_PATH_LITERAL("/new/target_path"));
858 download.mime_type = "new/mime/type"; 896 download.mime_type = "new/mime/type";
859 download.original_mime_type = "new/original/mime/type"; 897 download.original_mime_type = "new/original/mime/type";
860 download.received_bytes += 1000; 898 download.received_bytes += 1000;
861 download.state = DownloadState::CANCELLED; 899 download.state = DownloadState::CANCELLED;
862 download.danger_type = DownloadDangerType::USER_VALIDATED; 900 download.danger_type = DownloadDangerType::USER_VALIDATED;
863 download.interrupt_reason = 4; 901 download.interrupt_reason = 4;
864 download.end_time += base::TimeDelta::FromHours(1); 902 download.end_time += base::TimeDelta::FromHours(1);
865 download.total_bytes += 1; 903 download.total_bytes += 1;
866 download.hash = "some-other-hash"; 904 download.hash = "some-other-hash";
867 download.opened = !download.opened; 905 download.opened = !download.opened;
906 download.visible = !download.visible;
868 download.by_ext_id = "by-new-extension-id"; 907 download.by_ext_id = "by-new-extension-id";
869 download.by_ext_name = "by-new-extension-name"; 908 download.by_ext_name = "by-new-extension-name";
870 download.etag = "new-etag"; 909 download.etag = "new-etag";
871 download.last_modified = "new-last-modified"; 910 download.last_modified = "new-last-modified";
872 911
873 ASSERT_TRUE(db_->UpdateDownload(download)); 912 ASSERT_TRUE(db_->UpdateDownload(download));
874 913
875 std::vector<DownloadRow> results; 914 std::vector<DownloadRow> results;
876 db_->QueryDownloads(&results); 915 db_->QueryDownloads(&results);
877 ASSERT_EQ(1u, results.size()); 916 ASSERT_EQ(1u, results.size());
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 base::Time now(base::Time::Now()); 996 base::Time now(base::Time::Now());
958 std::vector<GURL> url_chain; 997 std::vector<GURL> url_chain;
959 DownloadRow download( 998 DownloadRow download(
960 base::FilePath(FILE_PATH_LITERAL("foo-path")), 999 base::FilePath(FILE_PATH_LITERAL("foo-path")),
961 base::FilePath(FILE_PATH_LITERAL("foo-path")), url_chain, 1000 base::FilePath(FILE_PATH_LITERAL("foo-path")), url_chain,
962 GURL(std::string()), GURL(std::string()), GURL(std::string()), 1001 GURL(std::string()), GURL(std::string()), GURL(std::string()),
963 GURL(std::string()), std::string(), "application/octet-stream", 1002 GURL(std::string()), std::string(), "application/octet-stream",
964 "application/octet-stream", now, now, std::string(), std::string(), 0, 1003 "application/octet-stream", now, now, std::string(), std::string(), 0,
965 512, DownloadState::COMPLETE, DownloadDangerType::NOT_DANGEROUS, 1004 512, DownloadState::COMPLETE, DownloadDangerType::NOT_DANGEROUS,
966 kTestDownloadInterruptReasonNone, std::string(), 1, 1005 kTestDownloadInterruptReasonNone, std::string(), 1,
967 "05AF6C8E-E4E0-45D7-B5CE-BC99F7019918", 0, now, "by_ext_id", 1006 "05AF6C8E-E4E0-45D7-B5CE-BC99F7019918", 0, now, false, "by_ext_id",
968 "by_ext_name", std::vector<DownloadSliceInfo>()); 1007 "by_ext_name", std::vector<DownloadSliceInfo>());
969 1008
970 // Creating records without any urls should fail. 1009 // Creating records without any urls should fail.
971 EXPECT_FALSE(db_->CreateDownload(download)); 1010 EXPECT_FALSE(db_->CreateDownload(download));
972 1011
973 download.url_chain.push_back(GURL("foo-url")); 1012 download.url_chain.push_back(GURL("foo-url"));
974 EXPECT_TRUE(db_->CreateDownload(download)); 1013 EXPECT_TRUE(db_->CreateDownload(download));
975 1014
976 // Pretend that the URLs were dropped. 1015 // Pretend that the URLs were dropped.
977 DeleteBackend(); 1016 DeleteBackend();
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 DownloadRow download( 1127 DownloadRow download(
1089 base::FilePath(FILE_PATH_LITERAL("/path/1")), 1128 base::FilePath(FILE_PATH_LITERAL("/path/1")),
1090 base::FilePath(FILE_PATH_LITERAL("/path/2")), url_chain, 1129 base::FilePath(FILE_PATH_LITERAL("/path/2")), url_chain,
1091 GURL("http://example.com/referrer"), GURL("http://example.com"), 1130 GURL("http://example.com/referrer"), GURL("http://example.com"),
1092 GURL("http://example.com/tab-url"), 1131 GURL("http://example.com/tab-url"),
1093 GURL("http://example.com/tab-referrer"), "GET", "mime/type", 1132 GURL("http://example.com/tab-referrer"), "GET", "mime/type",
1094 "original/mime-type", start_time, end_time, "etag1", "last_modified_1", 1133 "original/mime-type", start_time, end_time, "etag1", "last_modified_1",
1095 received, 1500, DownloadState::INTERRUPTED, 1134 received, 1500, DownloadState::INTERRUPTED,
1096 DownloadDangerType::NOT_DANGEROUS, kTestDownloadInterruptReasonCrash, 1135 DownloadDangerType::NOT_DANGEROUS, kTestDownloadInterruptReasonCrash,
1097 "hash-value1", id, "FE672168-26EF-4275-A149-FEC25F6A75F9", false, 1136 "hash-value1", id, "FE672168-26EF-4275-A149-FEC25F6A75F9", false,
1098 last_access_time, "extension-id", "extension-name", slice_info); 1137 last_access_time, false, "extension-id", "extension-name", slice_info);
1099 ASSERT_TRUE(db_->CreateDownload(download)); 1138 ASSERT_TRUE(db_->CreateDownload(download));
1100 std::vector<DownloadRow> results; 1139 std::vector<DownloadRow> results;
1101 db_->QueryDownloads(&results); 1140 db_->QueryDownloads(&results);
1102 ASSERT_EQ(1u, results.size()); 1141 ASSERT_EQ(1u, results.size());
1103 EXPECT_EQ(download, results[0]); 1142 EXPECT_EQ(download, results[0]);
1104 1143
1105 download.received_bytes += 10; 1144 download.received_bytes += 10;
1106 download.download_slice_info[0].received_bytes = download.received_bytes; 1145 download.download_slice_info[0].received_bytes = download.received_bytes;
1107 ASSERT_TRUE(db_->UpdateDownload(download)); 1146 ASSERT_TRUE(db_->UpdateDownload(download));
1108 db_->QueryDownloads(&results); 1147 db_->QueryDownloads(&results);
(...skipping 14 matching lines...) Expand all
1123 base::Time last_access_time(start_time + base::TimeDelta::FromHours(5)); 1162 base::Time last_access_time(start_time + base::TimeDelta::FromHours(5));
1124 DownloadRow download( 1163 DownloadRow download(
1125 base::FilePath(FILE_PATH_LITERAL("/path/1")), 1164 base::FilePath(FILE_PATH_LITERAL("/path/1")),
1126 base::FilePath(FILE_PATH_LITERAL("/path/2")), url_chain, 1165 base::FilePath(FILE_PATH_LITERAL("/path/2")), url_chain,
1127 GURL("http://example.com/referrer"), GURL("http://example.com"), 1166 GURL("http://example.com/referrer"), GURL("http://example.com"),
1128 GURL("http://example.com/tab-url"), 1167 GURL("http://example.com/tab-url"),
1129 GURL("http://example.com/tab-referrer"), "GET", "mime/type", 1168 GURL("http://example.com/tab-referrer"), "GET", "mime/type",
1130 "original/mime-type", start_time, end_time, "etag1", "last_modified_1", 0, 1169 "original/mime-type", start_time, end_time, "etag1", "last_modified_1", 0,
1131 1500, DownloadState::INTERRUPTED, DownloadDangerType::NOT_DANGEROUS, 1170 1500, DownloadState::INTERRUPTED, DownloadDangerType::NOT_DANGEROUS,
1132 kTestDownloadInterruptReasonCrash, "hash-value1", id, 1171 kTestDownloadInterruptReasonCrash, "hash-value1", id,
1133 "FE672168-26EF-4275-A149-FEC25F6A75F9", false, last_access_time, 1172 "FE672168-26EF-4275-A149-FEC25F6A75F9", false, last_access_time, true,
1134 "extension-id", "extension-name", std::vector<DownloadSliceInfo>()); 1173 "extension-id", "extension-name", std::vector<DownloadSliceInfo>());
1135 ASSERT_TRUE(db_->CreateDownload(download)); 1174 ASSERT_TRUE(db_->CreateDownload(download));
1136 1175
1137 // Add a new slice and call UpdateDownload(). 1176 // Add a new slice and call UpdateDownload().
1138 download.download_slice_info.push_back(DownloadSliceInfo(id, 500, 100)); 1177 download.download_slice_info.push_back(DownloadSliceInfo(id, 500, 100));
1139 ASSERT_TRUE(db_->UpdateDownload(download)); 1178 ASSERT_TRUE(db_->UpdateDownload(download));
1140 std::vector<DownloadRow> results; 1179 std::vector<DownloadRow> results;
1141 db_->QueryDownloads(&results); 1180 db_->QueryDownloads(&results);
1142 ASSERT_EQ(1u, results.size()); 1181 ASSERT_EQ(1u, results.size());
1143 EXPECT_EQ(download.download_slice_info[0], results[0].download_slice_info[0]); 1182 EXPECT_EQ(download.download_slice_info[0], results[0].download_slice_info[0]);
(...skipping 20 matching lines...) Expand all
1164 DownloadRow download( 1203 DownloadRow download(
1165 base::FilePath(FILE_PATH_LITERAL("/path/1")), 1204 base::FilePath(FILE_PATH_LITERAL("/path/1")),
1166 base::FilePath(FILE_PATH_LITERAL("/path/2")), url_chain, 1205 base::FilePath(FILE_PATH_LITERAL("/path/2")), url_chain,
1167 GURL("http://example.com/referrer"), GURL("http://example.com"), 1206 GURL("http://example.com/referrer"), GURL("http://example.com"),
1168 GURL("http://example.com/tab-url"), 1207 GURL("http://example.com/tab-url"),
1169 GURL("http://example.com/tab-referrer"), "GET", "mime/type", 1208 GURL("http://example.com/tab-referrer"), "GET", "mime/type",
1170 "original/mime-type", start_time, end_time, "etag1", "last_modified_1", 1209 "original/mime-type", start_time, end_time, "etag1", "last_modified_1",
1171 received, 1500, DownloadState::INTERRUPTED, 1210 received, 1500, DownloadState::INTERRUPTED,
1172 DownloadDangerType::NOT_DANGEROUS, kTestDownloadInterruptReasonCrash, 1211 DownloadDangerType::NOT_DANGEROUS, kTestDownloadInterruptReasonCrash,
1173 "hash-value1", id, "FE672168-26EF-4275-A149-FEC25F6A75F9", false, 1212 "hash-value1", id, "FE672168-26EF-4275-A149-FEC25F6A75F9", false,
1174 last_access_time, "extension-id", "extension-name", slice_info); 1213 last_access_time, true, "extension-id", "extension-name", slice_info);
1175 ASSERT_TRUE(db_->CreateDownload(download)); 1214 ASSERT_TRUE(db_->CreateDownload(download));
1176 std::vector<DownloadRow> results; 1215 std::vector<DownloadRow> results;
1177 db_->QueryDownloads(&results); 1216 db_->QueryDownloads(&results);
1178 ASSERT_EQ(1u, results.size()); 1217 ASSERT_EQ(1u, results.size());
1179 // Only 3 slices are inserted. 1218 // Only 3 slices are inserted.
1180 EXPECT_EQ(3u, results[0].download_slice_info.size()); 1219 EXPECT_EQ(3u, results[0].download_slice_info.size());
1181 1220
1182 // If slice info vector is empty, all slice entries will be removed. 1221 // If slice info vector is empty, all slice entries will be removed.
1183 download.download_slice_info.clear(); 1222 download.download_slice_info.clear();
1184 ASSERT_TRUE(db_->UpdateDownload(download)); 1223 ASSERT_TRUE(db_->UpdateDownload(download));
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 // URL should win instead. 1370 // URL should win instead.
1332 std::vector<std::unique_ptr<PageUsageData>> results2 = 1371 std::vector<std::unique_ptr<PageUsageData>> results2 =
1333 db_->QuerySegmentUsage(time, 1, base::Bind(&FilterURL)); 1372 db_->QuerySegmentUsage(time, 1, base::Bind(&FilterURL));
1334 ASSERT_EQ(1u, results2.size()); 1373 ASSERT_EQ(1u, results2.size());
1335 EXPECT_EQ(url2, results2[0]->GetURL()); 1374 EXPECT_EQ(url2, results2[0]->GetURL());
1336 EXPECT_EQ(segment_id2, results2[0]->GetID()); 1375 EXPECT_EQ(segment_id2, results2[0]->GetID());
1337 } 1376 }
1338 1377
1339 } // namespace 1378 } // namespace
1340 } // namespace history 1379 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698