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

Unified Diff: components/omnibox/browser/suggestion_answer_unittest.cc

Issue 2091473003: Factor parsing "ln=" to SuggestionAnswer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/omnibox/browser/suggestion_answer_unittest.cc
diff --git a/components/omnibox/browser/suggestion_answer_unittest.cc b/components/omnibox/browser/suggestion_answer_unittest.cc
index a75e41238096797dfb1ab0ee77de58cd31b97dfb..b849d3b7d4daf3bc9b450f568fe6043cbcce5ee3 100644
--- a/components/omnibox/browser/suggestion_answer_unittest.cc
+++ b/components/omnibox/browser/suggestion_answer_unittest.cc
@@ -199,10 +199,10 @@ TEST(SuggestionAnswerTest, URLPresent) {
TEST(SuggestionAnswerTest, ValidPropertyValues) {
std::string json =
"{ \"l\": ["
- " { \"il\": { \"t\": [{ \"t\": \"text\", \"tt\": 8, \"ln\": 3 }, "
+ " { \"il\": { \"t\": [{ \"t\": \"text\", \"tt\": 8 }, "
" { \"t\": \"moar text\", \"tt\": 0 }], "
" \"i\": { \"d\": \"//example.com/foo.jpg\" } } }, "
- " { \"il\": { \"t\": [{ \"t\": \"other text\", \"tt\": 5 }], "
+ " { \"il\": { \"t\": [{ \"t\": \"other text\", \"tt\": 5, \"ln\": 3 }], "
" \"at\": { \"t\": \"slatfatf\", \"tt\": 42 }, "
" \"st\": { \"t\": \"oh hi, Mark\", \"tt\": 729347 } } } "
"] }";
@@ -215,8 +215,6 @@ TEST(SuggestionAnswerTest, ValidPropertyValues) {
EXPECT_EQ(2U, first_line.text_fields().size());
EXPECT_EQ(base::UTF8ToUTF16("text"), first_line.text_fields()[0].text());
EXPECT_EQ(8, first_line.text_fields()[0].type());
- EXPECT_TRUE(first_line.text_fields()[0].has_num_lines());
groby-ooo-7-16 2016/06/23 20:49:27 Why did this check move from the first to the seco
Kevin Bailey 2016/06/23 21:49:23 Since ParseTextField is looking for it, we can han
- EXPECT_EQ(3, first_line.text_fields()[0].num_lines());
EXPECT_EQ(base::UTF8ToUTF16("moar text"), first_line.text_fields()[1].text());
EXPECT_EQ(0, first_line.text_fields()[1].type());
EXPECT_FALSE(first_line.text_fields()[1].has_num_lines());
@@ -232,6 +230,9 @@ TEST(SuggestionAnswerTest, ValidPropertyValues) {
EXPECT_EQ(
base::UTF8ToUTF16("other text"), second_line.text_fields()[0].text());
EXPECT_EQ(5, second_line.text_fields()[0].type());
+ EXPECT_TRUE(second_line.text_fields()[0].has_num_lines());
+ EXPECT_EQ(3, second_line.text_fields()[0].num_lines());
+ EXPECT_EQ(3, answer->SecondLineSize());
EXPECT_TRUE(second_line.additional_text());
EXPECT_EQ(

Powered by Google App Engine
This is Rietveld 408576698