Upload upstream chromium 114.0.5735.31
[platform/framework/web/chromium-efl.git] / components / search_engines / template_url_data_unittest.cc
1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/search_engines/template_url_data.h"
6
7 #include "base/strings/string_piece.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "base/values.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 TEST(TemplateURLDataTest, Trim) {
13   TemplateURLData data(
14       u" shortname ", u" keyword ", "https://cs.chromium.org",
15       base::StringPiece(), base::StringPiece(), base::StringPiece(),
16       base::StringPiece(), base::StringPiece(), base::StringPiece(),
17       base::StringPiece(), base::StringPiece(), base::StringPiece(),
18       base::StringPiece(), base::StringPiece(), base::StringPiece(),
19       base::StringPiece(), base::StringPiece(), {}, base::StringPiece(),
20       base::StringPiece(), base::StringPiece16(), base::Value::List(), false,
21       false, 0);
22
23   EXPECT_EQ(u"shortname", data.short_name());
24   EXPECT_EQ(u"keyword", data.keyword());
25
26   data.SetShortName(u" othershortname ");
27   data.SetKeyword(u" otherkeyword ");
28
29   EXPECT_EQ(u"othershortname", data.short_name());
30   EXPECT_EQ(u"otherkeyword", data.keyword());
31 }