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 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/search_engines/template_url.h" | 15 #include "chrome/browser/search_engines/template_url.h" |
16 #include "chrome/browser/webdata/keyword_table.h" | 16 #include "chrome/browser/webdata/keyword_table.h" |
17 #include "chrome/browser/webdata/web_database.h" | 17 #include "chrome/browser/webdata/web_database.h" |
18 #include "chrome/common/chrome_paths.h" | |
19 #include "sql/statement.h" | 18 #include "sql/statement.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
21 | 20 |
22 using base::Time; | 21 using base::Time; |
23 using base::TimeDelta; | 22 using base::TimeDelta; |
24 | 23 |
25 class KeywordTableTest : public testing::Test { | 24 class KeywordTableTest : public testing::Test { |
26 public: | 25 public: |
27 KeywordTableTest() {} | 26 KeywordTableTest() {} |
28 virtual ~KeywordTableTest() {} | 27 virtual ~KeywordTableTest() {} |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 sql::Statement s(table_->db_->GetUniqueStatement( | 296 sql::Statement s(table_->db_->GetUniqueStatement( |
298 "UPDATE keywords SET url=? WHERE id=?")); | 297 "UPDATE keywords SET url=? WHERE id=?")); |
299 s.BindString16(0, string16()); | 298 s.BindString16(0, string16()); |
300 s.BindInt64(1, 2000); | 299 s.BindInt64(1, 2000); |
301 EXPECT_TRUE(s.Run()); | 300 EXPECT_TRUE(s.Run()); |
302 | 301 |
303 // GetKeywords() should erase the entry with the empty URL field. | 302 // GetKeywords() should erase the entry with the empty URL field. |
304 EXPECT_TRUE(table_->GetKeywords(&keywords)); | 303 EXPECT_TRUE(table_->GetKeywords(&keywords)); |
305 EXPECT_EQ(1U, keywords.size()); | 304 EXPECT_EQ(1U, keywords.size()); |
306 } | 305 } |
OLD | NEW |