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

Side by Side Diff: trunk/src/third_party/libaddressinput/chromium/chrome_rule_test.cc

Issue 387123004: Revert 282726 "Reland "Use upstream libaddressinput in Chrome."" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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 "third_party/libaddressinput/src/cpp/src/rule.h" 5 #include "third_party/libaddressinput/chromium/cpp/src/rule.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 TEST(RuleTest, CanonicalizeSubKeyTest) { 12 TEST(RuleTest, CanonicalizeSubKeyTest) {
13 i18n::addressinput::Rule rule; 13 i18n::addressinput::Rule rule;
14 ASSERT_TRUE(rule.ParseSerializedRule(base::WideToUTF8( 14 ASSERT_TRUE(rule.ParseSerializedRule(base::WideToUTF8(
15 L"{ \"sub_keys\": \"FOO~BAR~B\u00C4Z~\u0415\u0416\"," 15 L"{ \"sub_keys\": \"FOO~BAR~B\u00C4Z~\u0415\u0416\","
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 for (size_t i = 0; i < num_cases; ++i) { 49 for (size_t i = 0; i < num_cases; ++i) {
50 const std::string input(base::WideToUTF8(expectations[i].input)); 50 const std::string input(base::WideToUTF8(expectations[i].input));
51 const std::string expected_output(base::WideToUTF8(expectations[i].output)); 51 const std::string expected_output(base::WideToUTF8(expectations[i].output));
52 std::string output; 52 std::string output;
53 EXPECT_EQ(!expected_output.empty(), 53 EXPECT_EQ(!expected_output.empty(),
54 rule.CanonicalizeSubKey(input, true, &output)) 54 rule.CanonicalizeSubKey(input, true, &output))
55 << "Failed for input " << input; 55 << "Failed for input " << input;
56 EXPECT_EQ(expected_output, output); 56 EXPECT_EQ(expected_output, output);
57 } 57 }
58 } 58 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698