OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_provider.h" | 5 #include "chrome/browser/autocomplete/shortcuts_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
17 #include "chrome/browser/autocomplete/autocomplete.h" | 17 #include "chrome/browser/autocomplete/autocomplete.h" |
18 #include "chrome/browser/autocomplete/autocomplete_match.h" | 18 #include "chrome/browser/autocomplete/autocomplete_match.h" |
19 #include "chrome/browser/history/history.h" | 19 #include "chrome/browser/history/history.h" |
20 #include "chrome/browser/history/in_memory_url_index.h" | 20 #include "chrome/browser/history/in_memory_url_index.h" |
21 #include "chrome/browser/history/url_database.h" | 21 #include "chrome/browser/history/url_database.h" |
22 #include "chrome/browser/prefs/pref_service.h" | 22 #include "chrome/browser/prefs/pref_service.h" |
23 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
| 24 #include "chrome/test/base/testing_browser_process.h" |
| 25 #include "chrome/test/base/testing_browser_process_test.h" |
24 #include "chrome/test/base/testing_profile.h" | 26 #include "chrome/test/base/testing_profile.h" |
25 #include "chrome/test/testing_browser_process.h" | |
26 #include "chrome/test/testing_browser_process_test.h" | |
27 #include "content/browser/browser_thread.h" | 27 #include "content/browser/browser_thread.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
29 | 29 |
30 using base::Time; | 30 using base::Time; |
31 using base::TimeDelta; | 31 using base::TimeDelta; |
32 | 32 |
33 struct TestShortcutInfo { | 33 struct TestShortcutInfo { |
34 std::string url; | 34 std::string url; |
35 std::string title; // The text that orginally was searched for. | 35 std::string title; // The text that orginally was searched for. |
36 std::string contents; | 36 std::string contents; |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 | 589 |
590 match.destination_url = GURL(shortcuts_to_test_delete[2].url); | 590 match.destination_url = GURL(shortcuts_to_test_delete[2].url); |
591 match.contents = ASCIIToUTF16(shortcuts_to_test_delete[2].contents); | 591 match.contents = ASCIIToUTF16(shortcuts_to_test_delete[2].contents); |
592 match.description = ASCIIToUTF16(shortcuts_to_test_delete[2].description); | 592 match.description = ASCIIToUTF16(shortcuts_to_test_delete[2].description); |
593 | 593 |
594 provider_->DeleteMatch(match); | 594 provider_->DeleteMatch(match); |
595 EXPECT_EQ(original_shortcuts_count, provider_->shortcuts_map_.size()); | 595 EXPECT_EQ(original_shortcuts_count, provider_->shortcuts_map_.size()); |
596 EXPECT_TRUE(provider_->shortcuts_map_.end() == | 596 EXPECT_TRUE(provider_->shortcuts_map_.end() == |
597 provider_->shortcuts_map_.find(ASCIIToUTF16("delete"))); | 597 provider_->shortcuts_map_.find(ASCIIToUTF16("delete"))); |
598 } | 598 } |
OLD | NEW |