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

Unified Diff: chrome/browser/chromeos/cros/network_library_impl_stub.cc

Issue 10824208: Fix logic for VPN badges and network menu order (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/status/network_menu_icon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros/network_library_impl_stub.cc
diff --git a/chrome/browser/chromeos/cros/network_library_impl_stub.cc b/chrome/browser/chromeos/cros/network_library_impl_stub.cc
index 7a8111e18fb8173d170f13aad6523675f82c7acd..4f0b70049d962509a98f1cb2ea2ff32f52c44612 100644
--- a/chrome/browser/chromeos/cros/network_library_impl_stub.cc
+++ b/chrome/browser/chromeos/cros/network_library_impl_stub.cc
@@ -73,14 +73,11 @@ void NetworkLibraryImplStub::Init() {
// If these change, the expectations in network_library_unittest and
// network_menu_icon_unittest need to be changed also.
- // Networks are added in priority order.
- network_priority_order_ = 0;
-
Network* ethernet = new EthernetNetwork("eth1");
ethernet->set_name("Fake Ethernet");
- ethernet->set_is_active(true);
ethernet->set_connected();
AddStubNetwork(ethernet, PROFILE_SHARED);
+ ethernet->set_is_active(ethernet->connected());
WifiNetwork* wifi1 = new WifiNetwork("wifi1");
wifi1->set_name("Fake WiFi1");
@@ -287,7 +284,8 @@ void NetworkLibraryImplStub::Init() {
// Ensure our active network is connected and vice versa, otherwise our
// autotest browser_tests sometimes conclude the device is offline.
- CHECK(active_network()->connected());
+ CHECK(active_network()->connected())
+ << "Active: " << active_network()->name();
CHECK(connected_network()->is_active());
std::string test_blob(
@@ -325,7 +323,8 @@ bool NetworkLibraryImplStub::IsCros() const {
void NetworkLibraryImplStub::AddStubNetwork(
Network* network, NetworkProfileType profile_type) {
- network->priority_order_ = network_priority_order_++;
+ // Currently we don't prioritize networks in Shill so don't do so in the stub.
+ // network->priority_order_ = network_priority_order_++;
network->CalculateUniqueId();
if (!network->unique_id().empty())
network_unique_id_map_[network->unique_id()] = network;
@@ -407,6 +406,12 @@ void NetworkLibraryImplStub::ConnectToNetwork(Network* network) {
}
}
+ // Disconnect ethernet when connecting to a new network (for UI testing).
+ if (network->type() != TYPE_VPN) {
+ ethernet_->set_is_active(false);
+ ethernet_->set_disconnected();
+ }
+
// Set connected state.
network->set_connected();
network->set_connection_started(false);
« no previous file with comments | « no previous file | chrome/browser/chromeos/status/network_menu_icon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698