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

Side by Side Diff: chromeos/network/network_state_unittest.cc

Issue 2168003003: Replace ICU encoding detection with CED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments/add datafiles back Created 4 years, 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chromeos/network/network_state.h" 5 #include "chromeos/network/network_state.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 std::string wifi_utf8_result = "UTF-8 \xE3\x81\x82\xE3\x81\x84\xE3\x81\x86"; 123 std::string wifi_utf8_result = "UTF-8 \xE3\x81\x82\xE3\x81\x84\xE3\x81\x86";
124 EXPECT_TRUE(SetStringProperty(shill::kNameProperty, wifi_utf8)); 124 EXPECT_TRUE(SetStringProperty(shill::kNameProperty, wifi_utf8));
125 EXPECT_FALSE(SignalInitialPropertiesReceived()); 125 EXPECT_FALSE(SignalInitialPropertiesReceived());
126 EXPECT_EQ(network_state_.name(), wifi_utf8_result); 126 EXPECT_EQ(network_state_.name(), wifi_utf8_result);
127 } 127 }
128 128
129 // latin1 SSID -> UTF8 SSID (Hex) 129 // latin1 SSID -> UTF8 SSID (Hex)
130 TEST_F(NetworkStateTest, SsidLatin) { 130 TEST_F(NetworkStateTest, SsidLatin) {
131 EXPECT_TRUE(SetStringProperty(shill::kTypeProperty, shill::kTypeWifi)); 131 EXPECT_TRUE(SetStringProperty(shill::kTypeProperty, shill::kTypeWifi));
132 132
133 std::string wifi_latin1 = "latin-1 \xc0\xcb\xcc\xd6\xfb"; 133 std::string wifi_latin1 = "latin-1 \x54\xe9\x6c\xe9\x63\x6f\x6d"; // Télécom
134 std::string wifi_latin1_hex = 134 std::string wifi_latin1_hex =
135 base::HexEncode(wifi_latin1.c_str(), wifi_latin1.length()); 135 base::HexEncode(wifi_latin1.c_str(), wifi_latin1.length());
136 std::string wifi_latin1_result = "latin-1 \u00c0\u00cb\u00cc\u00d6\u00fb"; 136 std::string wifi_latin1_result = "latin-1 T\xc3\xa9\x6c\xc3\xa9\x63om";
137 EXPECT_TRUE(SetStringProperty(shill::kWifiHexSsid, wifi_latin1_hex)); 137 EXPECT_TRUE(SetStringProperty(shill::kWifiHexSsid, wifi_latin1_hex));
138 EXPECT_TRUE(SignalInitialPropertiesReceived()); 138 EXPECT_TRUE(SignalInitialPropertiesReceived());
139 EXPECT_EQ(network_state_.name(), wifi_latin1_result); 139 EXPECT_EQ(network_state_.name(), wifi_latin1_result);
140 } 140 }
141 141
142 // Hex SSID 142 // Hex SSID
143 TEST_F(NetworkStateTest, SsidHex) { 143 TEST_F(NetworkStateTest, SsidHex) {
144 EXPECT_TRUE(SetStringProperty(shill::kTypeProperty, shill::kTypeWifi)); 144 EXPECT_TRUE(SetStringProperty(shill::kTypeProperty, shill::kTypeWifi));
145 145
146 std::string wifi_hex_result = "This is HEX SSID!"; 146 std::string wifi_hex_result = "This is HEX SSID!";
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 provider->SetStringWithoutPathExpansion( 232 provider->SetStringWithoutPathExpansion(
233 shill::kHostProperty, "third-party-vpn-provider-extension-id"); 233 shill::kHostProperty, "third-party-vpn-provider-extension-id");
234 EXPECT_TRUE(SetProperty(shill::kProviderProperty, std::move(provider))); 234 EXPECT_TRUE(SetProperty(shill::kProviderProperty, std::move(provider)));
235 SignalInitialPropertiesReceived(); 235 SignalInitialPropertiesReceived();
236 EXPECT_EQ(network_state_.vpn_provider_type(), shill::kProviderThirdPartyVpn); 236 EXPECT_EQ(network_state_.vpn_provider_type(), shill::kProviderThirdPartyVpn);
237 EXPECT_EQ(network_state_.third_party_vpn_provider_extension_id(), 237 EXPECT_EQ(network_state_.third_party_vpn_provider_extension_id(),
238 "third-party-vpn-provider-extension-id"); 238 "third-party-vpn-provider-extension-id");
239 } 239 }
240 240
241 } // namespace chromeos 241 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698