| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/sql/connection.h" | 5 #include "app/sql/connection.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/browser/history/url_database.h" | 10 #include "chrome/browser/history/url_database.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 // make sure it got updated | 106 // make sure it got updated |
| 107 URLRow info2; | 107 URLRow info2; |
| 108 EXPECT_TRUE(GetRowForURL(url2, &info2)); | 108 EXPECT_TRUE(GetRowForURL(url2, &info2)); |
| 109 EXPECT_TRUE(IsURLRowEqual(url_info2, info2)); | 109 EXPECT_TRUE(IsURLRowEqual(url_info2, info2)); |
| 110 | 110 |
| 111 // query a nonexistant URL | 111 // query a nonexistant URL |
| 112 EXPECT_EQ(0, GetRowForURL(GURL("http://news.google.com/"), &info)); | 112 EXPECT_EQ(0, GetRowForURL(GURL("http://news.google.com/"), &info)); |
| 113 | 113 |
| 114 // Delete all urls in the domain | 114 // Delete all urls in the domain |
| 115 // FIXME(ACW) test the new url based delete domain | 115 // TODO(acw): test the new url based delete domain |
| 116 //EXPECT_TRUE(db.DeleteDomain(kDomainID)); | 116 // EXPECT_TRUE(db.DeleteDomain(kDomainID)); |
| 117 | 117 |
| 118 // Make sure the urls have been properly removed | 118 // Make sure the urls have been properly removed |
| 119 // FIXME(ACW) commented out because remove no longer works. | 119 // TODO(acw): commented out because remove no longer works. |
| 120 //EXPECT_TRUE(db.GetURLInfo(url1, NULL) == NULL); | 120 // EXPECT_TRUE(db.GetURLInfo(url1, NULL) == NULL); |
| 121 //EXPECT_TRUE(db.GetURLInfo(url2, NULL) == NULL); | 121 // EXPECT_TRUE(db.GetURLInfo(url2, NULL) == NULL); |
| 122 } | 122 } |
| 123 | 123 |
| 124 // Tests adding, querying and deleting keyword visits. | 124 // Tests adding, querying and deleting keyword visits. |
| 125 TEST_F(URLDatabaseTest, KeywordSearchTermVisit) { | 125 TEST_F(URLDatabaseTest, KeywordSearchTermVisit) { |
| 126 const GURL url1("http://www.google.com/"); | 126 const GURL url1("http://www.google.com/"); |
| 127 URLRow url_info1(url1); | 127 URLRow url_info1(url1); |
| 128 url_info1.set_title(L"Google"); | 128 url_info1.set_title(L"Google"); |
| 129 url_info1.set_visit_count(4); | 129 url_info1.set_visit_count(4); |
| 130 url_info1.set_typed_count(2); | 130 url_info1.set_typed_count(2); |
| 131 url_info1.set_last_visit(Time::Now() - TimeDelta::FromDays(1)); | 131 url_info1.set_last_visit(Time::Now() - TimeDelta::FromDays(1)); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Delete the url. | 169 // Delete the url. |
| 170 ASSERT_TRUE(DeleteURLRow(url_id)); | 170 ASSERT_TRUE(DeleteURLRow(url_id)); |
| 171 | 171 |
| 172 // Make sure the keyword visit was deleted. | 172 // Make sure the keyword visit was deleted. |
| 173 std::vector<KeywordSearchTermVisit> matches; | 173 std::vector<KeywordSearchTermVisit> matches; |
| 174 GetMostRecentKeywordSearchTerms(1, L"visit", 10, &matches); | 174 GetMostRecentKeywordSearchTerms(1, L"visit", 10, &matches); |
| 175 ASSERT_EQ(0U, matches.size()); | 175 ASSERT_EQ(0U, matches.size()); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace history | 178 } // namespace history |
| OLD | NEW |