| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/history/shortcuts_database.h" | 11 #include "chrome/browser/history/shortcuts_database.h" |
| 12 #include "chrome/common/guid.h" | |
| 13 #include "sql/statement.h" | 12 #include "sql/statement.h" |
| 14 | 13 |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 15 |
| 17 namespace history { | 16 namespace history { |
| 18 | 17 |
| 19 struct ShortcutsDatabaseTestInfo { | 18 struct ShortcutsDatabaseTestInfo { |
| 20 std::string guid; | 19 std::string guid; |
| 21 std::string url; | 20 std::string url; |
| 22 std::string title; // The text that orginally was searched for. | 21 std::string title; // The text that orginally was searched for. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 AddAll(); | 182 AddAll(); |
| 184 ShortcutsDatabase::GuidToShortcutMap shortcuts; | 183 ShortcutsDatabase::GuidToShortcutMap shortcuts; |
| 185 EXPECT_TRUE(db_->LoadShortcuts(&shortcuts)); | 184 EXPECT_TRUE(db_->LoadShortcuts(&shortcuts)); |
| 186 EXPECT_EQ(arraysize(shortcut_test_db), shortcuts.size()); | 185 EXPECT_EQ(arraysize(shortcut_test_db), shortcuts.size()); |
| 187 EXPECT_TRUE(db_->DeleteAllShortcuts()); | 186 EXPECT_TRUE(db_->DeleteAllShortcuts()); |
| 188 EXPECT_TRUE(db_->LoadShortcuts(&shortcuts)); | 187 EXPECT_TRUE(db_->LoadShortcuts(&shortcuts)); |
| 189 EXPECT_EQ(0U, shortcuts.size()); | 188 EXPECT_EQ(0U, shortcuts.size()); |
| 190 } | 189 } |
| 191 | 190 |
| 192 } // namespace history | 191 } // namespace history |
| OLD | NEW |