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 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 scoped_refptr<BookmarkProvider> provider_; | 67 scoped_refptr<BookmarkProvider> provider_; |
68 | 68 |
69 private: | 69 private: |
70 DISALLOW_COPY_AND_ASSIGN(BookmarkProviderTest); | 70 DISALLOW_COPY_AND_ASSIGN(BookmarkProviderTest); |
71 }; | 71 }; |
72 | 72 |
73 void BookmarkProviderTest::SetUp() { | 73 void BookmarkProviderTest::SetUp() { |
74 profile_.reset(new TestingProfile()); | 74 profile_.reset(new TestingProfile()); |
75 DCHECK(profile_.get()); | 75 DCHECK(profile_.get()); |
76 provider_ = new BookmarkProvider(this, profile_.get()); | 76 provider_ = new BookmarkProvider(this, profile_.get()); |
77 DCHECK(provider_); | 77 DCHECK(provider_.get()); |
78 provider_->set_bookmark_model_for_testing(model_.get()); | 78 provider_->set_bookmark_model_for_testing(model_.get()); |
79 | 79 |
80 const BookmarkNode* other_node = model_->other_node(); | 80 const BookmarkNode* other_node = model_->other_node(); |
81 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(bookmark_provider_test_data); ++i) { | 81 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(bookmark_provider_test_data); ++i) { |
82 const BookmarksTestInfo& cur(bookmark_provider_test_data[i]); | 82 const BookmarksTestInfo& cur(bookmark_provider_test_data[i]); |
83 const GURL url(cur.url); | 83 const GURL url(cur.url); |
84 model_->AddURL(other_node, other_node->child_count(), | 84 model_->AddURL(other_node, other_node->child_count(), |
85 ASCIIToUTF16(cur.title), url); | 85 ASCIIToUTF16(cur.title), url); |
86 } | 86 } |
87 } | 87 } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 << query_data[i].matches[j] << "' for query: '" | 332 << query_data[i].matches[j] << "' for query: '" |
333 << query_data[i].query << "'."; | 333 << query_data[i].query << "'."; |
334 if (j >= matches.size()) | 334 if (j >= matches.size()) |
335 continue; | 335 continue; |
336 EXPECT_EQ(query_data[i].matches[j], UTF16ToUTF8(matches[j].description)) | 336 EXPECT_EQ(query_data[i].matches[j], UTF16ToUTF8(matches[j].description)) |
337 << " Mismatch at [" << base::IntToString(j) << "] for query '" | 337 << " Mismatch at [" << base::IntToString(j) << "] for query '" |
338 << query_data[i].query << "'."; | 338 << query_data[i].query << "'."; |
339 } | 339 } |
340 } | 340 } |
341 } | 341 } |
OLD | NEW |