| 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/bookmark_provider.h" | 5 #include "chrome/browser/autocomplete/bookmark_provider.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" | 17 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
| 18 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
| 19 #include "components/autocomplete/autocomplete_provider.h" | |
| 20 #include "components/bookmarks/browser/bookmark_match.h" | 19 #include "components/bookmarks/browser/bookmark_match.h" |
| 21 #include "components/bookmarks/browser/bookmark_model.h" | 20 #include "components/bookmarks/browser/bookmark_model.h" |
| 22 #include "components/bookmarks/test/test_bookmark_client.h" | 21 #include "components/bookmarks/test/test_bookmark_client.h" |
| 23 #include "components/metrics/proto/omnibox_event.pb.h" | 22 #include "components/metrics/proto/omnibox_event.pb.h" |
| 23 #include "components/omnibox/autocomplete_provider.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 25 | 25 |
| 26 using bookmarks::BookmarkMatch; | 26 using bookmarks::BookmarkMatch; |
| 27 | 27 |
| 28 // The bookmark corpus against which we will simulate searches. | 28 // The bookmark corpus against which we will simulate searches. |
| 29 struct BookmarksTestInfo { | 29 struct BookmarksTestInfo { |
| 30 std::string title; | 30 std::string title; |
| 31 std::string url; | 31 std::string url; |
| 32 } bookmark_provider_test_data[] = { | 32 } bookmark_provider_test_data[] = { |
| 33 { "abc def", "http://www.catsanddogs.com/a" }, | 33 { "abc def", "http://www.catsanddogs.com/a" }, |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 ASSERT_EQ(2U, chunks.size()) << description; | 460 ASSERT_EQ(2U, chunks.size()) << description; |
| 461 size_t offset; | 461 size_t offset; |
| 462 EXPECT_TRUE(base::StringToSizeT(chunks[0], &offset)) << description; | 462 EXPECT_TRUE(base::StringToSizeT(chunks[0], &offset)) << description; |
| 463 EXPECT_EQ(offset, match.contents_class[i].offset) << description; | 463 EXPECT_EQ(offset, match.contents_class[i].offset) << description; |
| 464 int style; | 464 int style; |
| 465 EXPECT_TRUE(base::StringToInt(chunks[1], &style)) << description; | 465 EXPECT_TRUE(base::StringToInt(chunks[1], &style)) << description; |
| 466 EXPECT_EQ(style, match.contents_class[i].style) << description; | 466 EXPECT_EQ(style, match.contents_class[i].style) << description; |
| 467 } | 467 } |
| 468 } | 468 } |
| 469 } | 469 } |
| OLD | NEW |