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 "chrome/browser/autocomplete/shortcuts_backend.h" | 5 #include "chrome/browser/autocomplete/shortcuts_backend.h" |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 history::ShortcutsDatabase::Shortcut::MatchCore MatchCoreForTesting( | 31 history::ShortcutsDatabase::Shortcut::MatchCore MatchCoreForTesting( |
32 const std::string& url, | 32 const std::string& url, |
33 const std::string& contents_class = std::string(), | 33 const std::string& contents_class = std::string(), |
34 const std::string& description_class = std::string(), | 34 const std::string& description_class = std::string(), |
35 AutocompleteMatch::Type type = AutocompleteMatchType::URL_WHAT_YOU_TYPED); | 35 AutocompleteMatch::Type type = AutocompleteMatchType::URL_WHAT_YOU_TYPED); |
36 void SetSearchProvider(); | 36 void SetSearchProvider(); |
37 | 37 |
38 virtual void SetUp(); | 38 virtual void SetUp(); |
39 virtual void TearDown(); | 39 virtual void TearDown(); |
40 | 40 |
41 virtual void OnShortcutsLoaded() OVERRIDE; | 41 virtual void OnShortcutsLoaded() override; |
42 virtual void OnShortcutsChanged() OVERRIDE; | 42 virtual void OnShortcutsChanged() override; |
43 | 43 |
44 const ShortcutsBackend::ShortcutMap& shortcuts_map() const { | 44 const ShortcutsBackend::ShortcutMap& shortcuts_map() const { |
45 return backend_->shortcuts_map(); | 45 return backend_->shortcuts_map(); |
46 } | 46 } |
47 bool changed_notified() const { return changed_notified_; } | 47 bool changed_notified() const { return changed_notified_; } |
48 void set_changed_notified(bool changed_notified) { | 48 void set_changed_notified(bool changed_notified) { |
49 changed_notified_ = changed_notified; | 49 changed_notified_ = changed_notified; |
50 } | 50 } |
51 | 51 |
52 void InitBackend(); | 52 void InitBackend(); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 ASSERT_TRUE(shortcut4_iter != shortcuts_map().end()); | 313 ASSERT_TRUE(shortcut4_iter != shortcuts_map().end()); |
314 EXPECT_EQ(shortcut4.id, shortcut4_iter->second.id); | 314 EXPECT_EQ(shortcut4.id, shortcut4_iter->second.id); |
315 | 315 |
316 history::ShortcutsDatabase::ShortcutIDs deleted_ids; | 316 history::ShortcutsDatabase::ShortcutIDs deleted_ids; |
317 deleted_ids.push_back(shortcut3.id); | 317 deleted_ids.push_back(shortcut3.id); |
318 deleted_ids.push_back(shortcut4.id); | 318 deleted_ids.push_back(shortcut4.id); |
319 EXPECT_TRUE(DeleteShortcutsWithIDs(deleted_ids)); | 319 EXPECT_TRUE(DeleteShortcutsWithIDs(deleted_ids)); |
320 | 320 |
321 ASSERT_EQ(0U, shortcuts_map().size()); | 321 ASSERT_EQ(0U, shortcuts_map().size()); |
322 } | 322 } |
OLD | NEW |