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

Unified Diff: components/omnibox/browser/fake_autocomplete_provider_client.h

Issue 2300323003: Adding performance tests for HQP that represent importance of optimising HistoryItemsForTerms method (Closed)
Patch Set: Review, round 4. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: components/omnibox/browser/fake_autocomplete_provider_client.h
diff --git a/components/omnibox/browser/fake_autocomplete_provider_client.h b/components/omnibox/browser/fake_autocomplete_provider_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..6aea2de9b58a1519ce143e8d4cf9bf667ac178ca
--- /dev/null
+++ b/components/omnibox/browser/fake_autocomplete_provider_client.h
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <memory>
+
+#include "base/files/scoped_temp_dir.h"
+#include "base/test/sequenced_worker_pool_owner.h"
+#include "components/omnibox/browser/mock_autocomplete_provider_client.h"
+#include "components/omnibox/browser/test_scheme_classifier.h"
+
+namespace bookmarks {
+class BookmarkModel;
+} // namespace bookmarks
+
+namespace history {
+class HistoryService;
+} // namespace history
+
+class InMemoryURLIndex;
+
+// Fully operational AutocompleteProviderClient for usage in tests.
+class FakeAutocompleteProviderClient : public MockAutocompleteProviderClient {
+ public:
+ FakeAutocompleteProviderClient();
+ ~FakeAutocompleteProviderClient() override;
+
+ const AutocompleteSchemeClassifier& GetSchemeClassifier() const override;
+ const SearchTermsData& GetSearchTermsData() const override;
+ history::HistoryService* GetHistoryService() override;
+ bookmarks::BookmarkModel* GetBookmarkModel() override;
+ InMemoryURLIndex* GetInMemoryURLIndex() override;
+
+ void set_in_memory_url_index(std::unique_ptr<InMemoryURLIndex> index) {
+ in_memory_url_index_ = std::move(index);
+ }
+
+ private:
+ base::SequencedWorkerPoolOwner pool_owner_;
+ base::ScopedTempDir history_dir_;
+ std::unique_ptr<bookmarks::BookmarkModel> bookmark_model_;
+ TestSchemeClassifier scheme_classifier_;
+ SearchTermsData search_terms_data_;
+ std::unique_ptr<InMemoryURLIndex> in_memory_url_index_;
+ std::unique_ptr<history::HistoryService> history_service_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeAutocompleteProviderClient);
+};
« no previous file with comments | « components/omnibox/browser/BUILD.gn ('k') | components/omnibox/browser/fake_autocomplete_provider_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698