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/bookmarks/bookmark_index.h" | 5 #include "chrome/browser/bookmarks/bookmark_index.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/string_split.h" | |
12 #include "base/string_util.h" | 11 #include "base/string_util.h" |
13 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_split.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
17 #include "chrome/browser/bookmarks/bookmark_utils.h" | 17 #include "chrome/browser/bookmarks/bookmark_utils.h" |
18 #include "chrome/browser/history/history_service.h" | 18 #include "chrome/browser/history/history_service.h" |
19 #include "chrome/browser/history/history_service_factory.h" | 19 #include "chrome/browser/history/history_service_factory.h" |
20 #include "chrome/browser/history/url_database.h" | 20 #include "chrome/browser/history/url_database.h" |
21 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
22 #include "content/public/test/test_browser_thread.h" | 22 #include "content/public/test/test_browser_thread.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 EXPECT_EQ(data[1].url, matches[3].node->url()); | 305 EXPECT_EQ(data[1].url, matches[3].node->url()); |
306 | 306 |
307 matches.clear(); | 307 matches.clear(); |
308 // Select top two matches. | 308 // Select top two matches. |
309 model->GetBookmarksWithTitlesMatching(ASCIIToUTF16("google"), 2, &matches); | 309 model->GetBookmarksWithTitlesMatching(ASCIIToUTF16("google"), 2, &matches); |
310 | 310 |
311 EXPECT_EQ(2, static_cast<int>(matches.size())); | 311 EXPECT_EQ(2, static_cast<int>(matches.size())); |
312 EXPECT_EQ(data[0].url, matches[0].node->url()); | 312 EXPECT_EQ(data[0].url, matches[0].node->url()); |
313 EXPECT_EQ(data[3].url, matches[1].node->url()); | 313 EXPECT_EQ(data[3].url, matches[1].node->url()); |
314 } | 314 } |
OLD | NEW |