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

Unified Diff: chromeos/network/network_state_unittest.cc

Issue 1019033002: Add an ONC property for the third-party VPN provider extension ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browser tests. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/network_state.cc ('k') | chromeos/network/onc/onc_normalizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state_unittest.cc
diff --git a/chromeos/network/network_state_unittest.cc b/chromeos/network/network_state_unittest.cc
index aa636d7b613bec4f2bde70837e9f0076c18cac3a..3ba359a5f608a1e305b2a9268e28efe3165c4a0c 100644
--- a/chromeos/network/network_state_unittest.cc
+++ b/chromeos/network/network_state_unittest.cc
@@ -54,11 +54,14 @@ class NetworkStateTest : public testing::Test {
}
protected:
+ bool SetProperty(const std::string& key, scoped_ptr<base::Value> value) {
+ const bool result = network_state_.PropertyChanged(key, *value);
+ properties_.SetWithoutPathExpansion(key, value.release());
+ return result;
+ }
+
bool SetStringProperty(const std::string& key, const std::string& value) {
- TestStringValue* string_value = new TestStringValue(value);
- bool res = network_state_.PropertyChanged(key, *string_value);
- properties_.SetWithoutPathExpansion(key, string_value);
- return res;
+ return SetProperty(key, make_scoped_ptr(new TestStringValue(value)));
}
bool SignalInitialPropertiesReceived() {
@@ -213,4 +216,21 @@ TEST_F(NetworkStateTest, CaptivePortalState) {
EXPECT_TRUE(network_state_.is_captive_portal());
}
+// Third-party VPN provider.
+TEST_F(NetworkStateTest, VPNThirdPartyProvider) {
+ EXPECT_TRUE(SetStringProperty(shill::kTypeProperty, shill::kTypeVPN));
+ EXPECT_TRUE(SetStringProperty(shill::kNameProperty, "VPN"));
+
+ scoped_ptr<base::DictionaryValue> provider(new base::DictionaryValue);
+ provider->SetStringWithoutPathExpansion(shill::kTypeProperty,
+ shill::kProviderThirdPartyVpn);
+ provider->SetStringWithoutPathExpansion(
+ shill::kHostProperty, "third-party-vpn-provider-extension-id");
+ EXPECT_TRUE(SetProperty(shill::kProviderProperty, provider.Pass()));
+ SignalInitialPropertiesReceived();
+ EXPECT_EQ(network_state_.vpn_provider_type(), shill::kProviderThirdPartyVpn);
+ EXPECT_EQ(network_state_.third_party_vpn_provider_extension_id(),
+ "third-party-vpn-provider-extension-id");
+}
+
} // namespace chromeos
« no previous file with comments | « chromeos/network/network_state.cc ('k') | chromeos/network/onc/onc_normalizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698