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

Side by Side Diff: components/omnibox/answers_cache_unittest.cc

Issue 489353004: Componentize SearchProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « components/omnibox/answers_cache.cc ('k') | components/omnibox/base_search_provider.h » ('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 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/answers_cache.h" 5 #include "components/omnibox/answers_cache.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 TEST(AnswersCacheTest, CacheStartsEmpty) { 10 TEST(AnswersCacheTest, CacheStartsEmpty) {
11 AnswersCache cache(1); 11 AnswersCache cache(1);
12 EXPECT_TRUE(cache.empty()); 12 EXPECT_TRUE(cache.empty());
13 } 13 }
14 14
15 TEST(AnswersCacheTest, UpdatePopulatesCache) { 15 TEST(AnswersCacheTest, UpdatePopulatesCache) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // Test that duplicate entries update recency. 104 // Test that duplicate entries update recency.
105 cache.UpdateRecentAnswers(query_weather_lb, query_type); 105 cache.UpdateRecentAnswers(query_weather_lb, query_type);
106 EXPECT_EQ(query_weather_lb, 106 EXPECT_EQ(query_weather_lb,
107 cache.GetTopAnswerEntry(query_weather_l).full_query_text); 107 cache.GetTopAnswerEntry(query_weather_l).full_query_text);
108 108
109 // Test duplicate do not evict other entries. LV should still be in cache. 109 // Test duplicate do not evict other entries. LV should still be in cache.
110 cache.UpdateRecentAnswers(query_weather_lb, query_type); 110 cache.UpdateRecentAnswers(query_weather_lb, query_type);
111 EXPECT_FALSE( 111 EXPECT_FALSE(
112 cache.GetTopAnswerEntry(query_weather_lv).full_query_text.empty()); 112 cache.GetTopAnswerEntry(query_weather_lv).full_query_text.empty());
113 } 113 }
OLDNEW
« no previous file with comments | « components/omnibox/answers_cache.cc ('k') | components/omnibox/base_search_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698