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

Unified Diff: chrome/browser/chromeos/extensions/networking_private_apitest.cc

Issue 13957012: Adding a NetworkProfileHandler used by ManagedNetworkConfigurationHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial patch. Created 7 years, 8 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: chrome/browser/chromeos/extensions/networking_private_apitest.cc
diff --git a/chrome/browser/chromeos/extensions/networking_private_apitest.cc b/chrome/browser/chromeos/extensions/networking_private_apitest.cc
index b8e8d16f22cc44f241fc1c25cbd1ce55195f437b..e8ddf77eeddd2f38e85fff31d7a01642ed076c7e 100644
--- a/chrome/browser/chromeos/extensions/networking_private_apitest.cc
+++ b/chrome/browser/chromeos/extensions/networking_private_apitest.cc
@@ -28,7 +28,8 @@ using testing::_;
namespace chromeos {
-const char kUserProfilePath[] = "/profile/chronos/shill";
+const char kUser1ProfilePath[] = "/profile/user1/shill";
+const char kUser1[] = "user1";
class ExtensionNetworkingPrivateApiTest : public ExtensionApiTest {
public:
@@ -59,23 +60,26 @@ class ExtensionNetworkingPrivateApiTest : public ExtensionApiTest {
ExtensionApiTest::SetUpOnMainThread();
content::RunAllPendingInMessageLoop();
+ ShillDeviceClient::TestInterface* device_test =
+ DBusThreadManager::Get()->GetShillDeviceClient()->GetTestInterface();
ShillProfileClient::TestInterface* profile_test =
DBusThreadManager::Get()->GetShillProfileClient()->GetTestInterface();
- profile_test->AddProfile(kUserProfilePath);
+ ShillServiceClient::TestInterface* service_test =
+ DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface();
g_browser_process->browser_policy_connector()->
GetNetworkConfigurationUpdater()->OnUserPolicyInitialized();
- ShillDeviceClient::TestInterface* device_test =
- DBusThreadManager::Get()->GetShillDeviceClient()->GetTestInterface();
device_test->ClearDevices();
+ service_test->ClearServices();
+
+ // Sends a notification about the added profile.
+ profile_test->AddProfile(kUser1ProfilePath, kUser1);
+
device_test->AddDevice("/device/stub_wifi_device1",
flimflam::kTypeWifi, "stub_wifi_device1");
device_test->AddDevice("/device/stub_cellular_device1",
flimflam::kTypeCellular, "stub_cellular_device1");
- ShillServiceClient::TestInterface* service_test =
- DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface();
- service_test->ClearServices();
const bool add_to_watchlist = true;
service_test->AddService("stub_ethernet", "eth0",
flimflam::kTypeEthernet, flimflam::kStateOnline,
@@ -100,6 +104,10 @@ class ExtensionNetworkingPrivateApiTest : public ExtensionApiTest {
service_test->SetServiceProperty("stub_wifi2",
flimflam::kSignalStrengthProperty,
base::FundamentalValue(80));
+ service_test->SetServiceProperty("stub_wifi2",
+ flimflam::kProfileProperty,
+ base::StringValue(kUser1ProfilePath));
+ profile_test->AddService("stub_wifi2");
service_test->AddService("stub_cellular1", "cellular1",
flimflam::kTypeCellular, flimflam::kStateIdle,
@@ -121,6 +129,8 @@ class ExtensionNetworkingPrivateApiTest : public ExtensionApiTest {
flimflam::kTypeVPN,
flimflam::kStateOnline,
add_to_watchlist);
+
+ content::RunAllPendingInMessageLoop();
}
protected:
@@ -189,25 +199,19 @@ IN_PROC_BROWSER_TEST_F(ExtensionNetworkingPrivateApiTest,
const std::string uidata_blob =
"{ \"user_settings\": {"
" \"WiFi\": {"
- " \"Passphrase\": \"top secret\" }"
+ " \"Passphrase\": \"FAKE_CREDENTIAL_VPaJDV9x\" }"
" }"
"}";
service_test->SetServiceProperty("stub_wifi2",
- flimflam::kGuidProperty,
- base::StringValue("stub_wifi2"));
- service_test->SetServiceProperty("stub_wifi2",
flimflam::kUIDataProperty,
base::StringValue(uidata_blob));
service_test->SetServiceProperty("stub_wifi2",
- flimflam::kProfileProperty,
- base::StringValue(kUserProfilePath));
- service_test->SetServiceProperty("stub_wifi2",
flimflam::kAutoConnectProperty,
base::FundamentalValue(false));
ShillProfileClient::TestInterface* profile_test =
DBusThreadManager::Get()->GetShillProfileClient()->GetTestInterface();
-
+ // Update the profile entry.
profile_test->AddService("stub_wifi2");
content::RunAllPendingInMessageLoop();

Powered by Google App Engine
This is Rietveld 408576698