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

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

Issue 870063002: Componentize TopSites, TopSitesBackend, TopSitesDatabase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@815983002
Patch Set: Fix typo Created 5 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/zero_suggest_provider.h" 5 #include "chrome/browser/autocomplete/zero_suggest_provider.h"
6 6
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 11 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
12 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" 12 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
13 #include "chrome/browser/history/top_sites.h"
14 #include "chrome/browser/history/top_sites_factory.h" 13 #include "chrome/browser/history/top_sites_factory.h"
15 #include "chrome/browser/search_engines/template_url_service_factory.h" 14 #include "chrome/browser/search_engines/template_url_service_factory.h"
16 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
17 #include "chrome/test/base/testing_profile.h" 16 #include "chrome/test/base/testing_profile.h"
17 #include "components/history/core/browser/top_sites.h"
18 #include "components/metrics/proto/omnibox_event.pb.h" 18 #include "components/metrics/proto/omnibox_event.pb.h"
19 #include "components/omnibox/autocomplete_provider_listener.h" 19 #include "components/omnibox/autocomplete_provider_listener.h"
20 #include "components/omnibox/omnibox_field_trial.h" 20 #include "components/omnibox/omnibox_field_trial.h"
21 #include "components/search_engines/template_url.h" 21 #include "components/search_engines/template_url.h"
22 #include "components/search_engines/template_url_service.h" 22 #include "components/search_engines/template_url_service.h"
23 #include "components/variations/entropy_provider.h" 23 #include "components/variations/entropy_provider.h"
24 #include "components/variations/variations_associated_data.h" 24 #include "components/variations/variations_associated_data.h"
25 #include "content/public/test/test_browser_thread_bundle.h" 25 #include "content/public/test/test_browser_thread_bundle.h"
26 #include "net/url_request/test_url_fetcher_factory.h" 26 #include "net/url_request/test_url_fetcher_factory.h"
27 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 bool IsNonForcedFull() override { 78 bool IsNonForcedFull() override {
79 return false; 79 return false;
80 } 80 }
81 bool IsForcedFull() override { 81 bool IsForcedFull() override {
82 return false; 82 return false;
83 } 83 }
84 bool loaded() const override { 84 bool loaded() const override {
85 return false; 85 return false;
86 } 86 }
87 history::MostVisitedURLList GetPrepopulatePages() override { 87 history::PrepopulatedPageList GetPrepopulatedPages() override {
88 return history::MostVisitedURLList(); 88 return history::PrepopulatedPageList();
89 } 89 }
90 bool AddForcedURL(const GURL& url, const base::Time& time) override { 90 bool AddForcedURL(const GURL& url, const base::Time& time) override {
91 return false; 91 return false;
92 } 92 }
93 93
94 // RefcountedKeyedService: 94 // RefcountedKeyedService:
95 void ShutdownOnUIThread() override {} 95 void ShutdownOnUIThread() override {}
96 96
97 // content::NotificationObserver:
98 void Observe(int type,
99 const content::NotificationSource& source,
100 const content::NotificationDetails& details) override {}
101
102 // A test-specific field for controlling when most visited callback is run 97 // A test-specific field for controlling when most visited callback is run
103 // after top sites have been requested. 98 // after top sites have been requested.
104 GetMostVisitedURLsCallback mv_callback; 99 GetMostVisitedURLsCallback mv_callback;
105 100
106 protected: 101 protected:
107 ~FakeEmptyTopSites() override {} 102 ~FakeEmptyTopSites() override {}
108 }; 103 };
109 104
110 void FakeEmptyTopSites::GetMostVisitedURLs( 105 void FakeEmptyTopSites::GetMostVisitedURLs(
111 const GetMostVisitedURLsCallback& callback, 106 const GetMostVisitedURLsCallback& callback,
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 443
449 base::RunLoop().RunUntilIdle(); 444 base::RunLoop().RunUntilIdle();
450 445
451 // Expect that the matches have been cleared. 446 // Expect that the matches have been cleared.
452 ASSERT_TRUE(provider_->matches().empty()); 447 ASSERT_TRUE(provider_->matches().empty());
453 448
454 // Expect the new results have been stored. 449 // Expect the new results have been stored.
455 EXPECT_EQ(empty_response, 450 EXPECT_EQ(empty_response,
456 prefs->GetString(prefs::kZeroSuggestCachedResults)); 451 prefs->GetString(prefs::kZeroSuggestCachedResults));
457 } 452 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/zero_suggest_provider.cc ('k') | chrome/browser/devtools/browser_list_tabcontents_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698