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

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: 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
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..679c04bac23bc701f3bc88ebfb23f11391540415 100644
--- a/chromeos/network/network_state_unittest.cc
+++ b/chromeos/network/network_state_unittest.cc
@@ -61,6 +61,12 @@ class NetworkStateTest : public testing::Test {
return res;
}
+ bool SetProperty(const std::string& key, scoped_ptr<base::Value> value) {
pneubeck (no reviews) 2015/03/18 19:35:29 nit: SetStringProperty above could call this funct
bartfab (slow) 2015/03/18 20:02:14 Done.
+ const bool result = network_state_.PropertyChanged(key, *value);
+ properties_.SetWithoutPathExpansion(key, value.release());
+ return result;
+ }
+
bool SignalInitialPropertiesReceived() {
return network_state_.InitialPropertiesReceived(properties_);
}
@@ -213,4 +219,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

Powered by Google App Engine
This is Rietveld 408576698