| 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/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 "slashdot.org", "0,3,5,1", | 35 "slashdot.org", "0,3,5,1", |
| 36 "Slashdot - News for nerds, stuff that matters", "0,2,5,0", 100, 0}, | 36 "Slashdot - News for nerds, stuff that matters", "0,2,5,0", 100, 0}, |
| 37 { "BD85DBA2-8C29-49F9-84AE-48E1E90880E1", | 37 { "BD85DBA2-8C29-49F9-84AE-48E1E90880E1", |
| 38 "http://slashdot.org/", "news", | 38 "http://slashdot.org/", "news", |
| 39 "slashdot.org", "0,1", | 39 "slashdot.org", "0,1", |
| 40 "Slashdot - News for nerds, stuff that matters", "0,0,11,2,15,0", 5, 0}, | 40 "Slashdot - News for nerds, stuff that matters", "0,0,11,2,15,0", 5, 0}, |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 class ShortcutsDatabaseTest : public testing::Test { | 43 class ShortcutsDatabaseTest : public testing::Test { |
| 44 public: | 44 public: |
| 45 void SetUp(); | 45 virtual void SetUp(); |
| 46 void TearDown(); | 46 virtual void TearDown(); |
| 47 | 47 |
| 48 void ClearDB(); | 48 void ClearDB(); |
| 49 size_t CountRecords() const; | 49 size_t CountRecords() const; |
| 50 | 50 |
| 51 ShortcutsBackend::Shortcut ShortcutFromTestInfo( | 51 ShortcutsBackend::Shortcut ShortcutFromTestInfo( |
| 52 const ShortcutsDatabaseTestInfo& info); | 52 const ShortcutsDatabaseTestInfo& info); |
| 53 | 53 |
| 54 void AddAll(); | 54 void AddAll(); |
| 55 | 55 |
| 56 scoped_ptr<TestingProfile> profile_; | 56 scoped_ptr<TestingProfile> profile_; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 AddAll(); | 183 AddAll(); |
| 184 ShortcutsDatabase::GuidToShortcutMap shortcuts; | 184 ShortcutsDatabase::GuidToShortcutMap shortcuts; |
| 185 EXPECT_TRUE(db_->LoadShortcuts(&shortcuts)); | 185 EXPECT_TRUE(db_->LoadShortcuts(&shortcuts)); |
| 186 EXPECT_EQ(arraysize(shortcut_test_db), shortcuts.size()); | 186 EXPECT_EQ(arraysize(shortcut_test_db), shortcuts.size()); |
| 187 EXPECT_TRUE(db_->DeleteAllShortcuts()); | 187 EXPECT_TRUE(db_->DeleteAllShortcuts()); |
| 188 EXPECT_TRUE(db_->LoadShortcuts(&shortcuts)); | 188 EXPECT_TRUE(db_->LoadShortcuts(&shortcuts)); |
| 189 EXPECT_EQ(0U, shortcuts.size()); | 189 EXPECT_EQ(0U, shortcuts.size()); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace history | 192 } // namespace history |
| OLD | NEW |