Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: chrome/browser/autocomplete/bookmark_provider_unittest.cc

Issue 1198963014: Change ownership of BookmarkClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_managed_and_supervised_nodes
Patch Set: Rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_model_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/omnibox/bookmark_provider.h" 5 #include "components/omnibox/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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 }; 70 };
71 71
72 class BookmarkProviderTest : public testing::Test { 72 class BookmarkProviderTest : public testing::Test {
73 public: 73 public:
74 BookmarkProviderTest(); 74 BookmarkProviderTest();
75 75
76 protected: 76 protected:
77 void SetUp() override; 77 void SetUp() override;
78 78
79 content::TestBrowserThreadBundle thread_bundle_; 79 content::TestBrowserThreadBundle thread_bundle_;
80 bookmarks::TestBookmarkClient bookmark_client_;
81 scoped_ptr<TestingProfile> profile_; 80 scoped_ptr<TestingProfile> profile_;
82 scoped_ptr<ChromeAutocompleteProviderClient> provider_client_; 81 scoped_ptr<ChromeAutocompleteProviderClient> provider_client_;
83 scoped_ptr<BookmarkModel> model_; 82 scoped_ptr<BookmarkModel> model_;
84 scoped_refptr<BookmarkProvider> provider_; 83 scoped_refptr<BookmarkProvider> provider_;
85 84
86 private: 85 private:
87 DISALLOW_COPY_AND_ASSIGN(BookmarkProviderTest); 86 DISALLOW_COPY_AND_ASSIGN(BookmarkProviderTest);
88 }; 87 };
89 88
90 BookmarkProviderTest::BookmarkProviderTest() { 89 BookmarkProviderTest::BookmarkProviderTest() {
91 model_ = bookmark_client_.CreateModel(); 90 model_ = bookmarks::TestBookmarkClient::CreateModel();
92 } 91 }
93 92
94 void BookmarkProviderTest::SetUp() { 93 void BookmarkProviderTest::SetUp() {
95 profile_.reset(new TestingProfile()); 94 profile_.reset(new TestingProfile());
96 DCHECK(profile_.get()); 95 DCHECK(profile_.get());
97 provider_client_.reset(new ChromeAutocompleteProviderClient(profile_.get())); 96 provider_client_.reset(new ChromeAutocompleteProviderClient(profile_.get()));
98 provider_ = new BookmarkProvider(provider_client_.get()); 97 provider_ = new BookmarkProvider(provider_client_.get());
99 DCHECK(provider_.get()); 98 DCHECK(provider_.get());
100 provider_->set_bookmark_model_for_testing(model_.get()); 99 provider_->set_bookmark_model_for_testing(model_.get());
101 100
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 } 480 }
482 481
483 TEST_F(BookmarkProviderTest, DoesNotProvideMatchesOnFocus) { 482 TEST_F(BookmarkProviderTest, DoesNotProvideMatchesOnFocus) {
484 AutocompleteInput input( 483 AutocompleteInput input(
485 base::ASCIIToUTF16("foo"), base::string16::npos, std::string(), GURL(), 484 base::ASCIIToUTF16("foo"), base::string16::npos, std::string(), GURL(),
486 metrics::OmniboxEventProto::INVALID_SPEC, false, false, false, true, true, 485 metrics::OmniboxEventProto::INVALID_SPEC, false, false, false, true, true,
487 ChromeAutocompleteSchemeClassifier(profile_.get())); 486 ChromeAutocompleteSchemeClassifier(profile_.get()));
488 provider_->Start(input, false); 487 provider_->Start(input, false);
489 EXPECT_TRUE(provider_->matches().empty()); 488 EXPECT_TRUE(provider_->matches().empty());
490 } 489 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_model_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698