OLD | NEW |
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> |
11 | 11 |
12 #include "base/i18n/streaming_utf8_validator.h" | 12 #include "base/i18n/streaming_utf8_validator.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "third_party/cros_system_api/dbus/service_constants.h" | 18 #include "third_party/cros_system_api/dbus/service_constants.h" |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // StringValue that skips the DCHECK in the constructor for valid UTF8. | 24 // StringValue that skips the DCHECK in the constructor for valid UTF8. |
25 class TestStringValue : public base::Value { | 25 class TestStringValue : public base::Value { |
26 public: | 26 public: |
27 explicit TestStringValue(const std::string& in_value) | 27 explicit TestStringValue(const std::string& in_value) |
28 : base::Value(TYPE_STRING), | 28 : base::Value(Type::STRING), value_(in_value) {} |
29 value_(in_value) { | |
30 } | |
31 | 29 |
32 ~TestStringValue() override {} | 30 ~TestStringValue() override {} |
33 | 31 |
34 // Overridden from Value: | 32 // Overridden from Value: |
35 bool GetAsString(std::string* out_value) const override { | 33 bool GetAsString(std::string* out_value) const override { |
36 if (out_value) | 34 if (out_value) |
37 *out_value = value_; | 35 *out_value = value_; |
38 return true; | 36 return true; |
39 } | 37 } |
40 | 38 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 provider->SetStringWithoutPathExpansion( | 230 provider->SetStringWithoutPathExpansion( |
233 shill::kHostProperty, "third-party-vpn-provider-extension-id"); | 231 shill::kHostProperty, "third-party-vpn-provider-extension-id"); |
234 EXPECT_TRUE(SetProperty(shill::kProviderProperty, std::move(provider))); | 232 EXPECT_TRUE(SetProperty(shill::kProviderProperty, std::move(provider))); |
235 SignalInitialPropertiesReceived(); | 233 SignalInitialPropertiesReceived(); |
236 EXPECT_EQ(network_state_.vpn_provider_type(), shill::kProviderThirdPartyVpn); | 234 EXPECT_EQ(network_state_.vpn_provider_type(), shill::kProviderThirdPartyVpn); |
237 EXPECT_EQ(network_state_.third_party_vpn_provider_extension_id(), | 235 EXPECT_EQ(network_state_.third_party_vpn_provider_extension_id(), |
238 "third-party-vpn-provider-extension-id"); | 236 "third-party-vpn-provider-extension-id"); |
239 } | 237 } |
240 | 238 |
241 } // namespace chromeos | 239 } // namespace chromeos |
OLD | NEW |