#include "components/omnibox/browser/suggestion_answer.h"
#include <algorithm>
#include <memory>
#include "base/json/json_reader.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/omnibox_proto/answer_data.pb.h"
#include "third_party/omnibox_proto/rich_answer_template.pb.h"
namespace {
bool ParseAnswer(const std::string& answer_json, SuggestionAnswer* answer) { … }
bool ParseJsonToAnswerData(const std::string& answer_json,
omnibox::RichAnswerTemplate* answer_template) { … }
}
TEST(SuggestionAnswerTest, DefaultAreEqual) { … }
TEST(SuggestionAnswerTest, CopiesAreEqual) { … }
TEST(SuggestionAnswerTest, DifferentValuesAreUnequal) { … }
TEST(SuggestionAnswerTest, EmptyJsonIsInvalid) { … }
TEST(SuggestionAnswerTest, MalformedJsonIsInvalid) { … }
TEST(SuggestionAnswerTest, TextFieldsRequireBothTextAndType) { … }
TEST(SuggestionAnswerTest, ImageLinesMustContainAtLeastOneTextField) { … }
TEST(SuggestionAnswerTest, ExactlyTwoLinesRequired) { … }
TEST(SuggestionAnswerTest, URLPresent) { … }
TEST(SuggestionAnswerTest, ValidPropertyValues) { … }
TEST(SuggestionAnswerTest, ParseAccessibilityLabel) { … }
TEST(SuggestionAnswerTest, AnswerData_EmptyJsonIsInvalid) { … }
TEST(SuggestionAnswerTest, AnswerData_MalformedJsonIsInvalid) { … }
TEST(SuggestionAnswerTest, AnswerData_ImageLinesMustContainAtLeastOneFragment) { … }
TEST(SuggestionAnswerTest, AnswerData_ExactlyTwoImageLinesRequired) { … }
TEST(SuggestionAnswerTest, AnswerData_FragmentsRequireBothTextAndType) { … }
TEST(SuggestionAnswerTest, AnswerData_URLPresent) { … }
TEST(SuggestionAnswerTest, AnswerData_ValidPropertyValues) { … }
TEST(SuggestionAnswerTest, AnswerData_ParseAccessibilityLabel) { … }