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

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

Issue 3678006: Implement action interface in network_menu.js for 'connect'. (Closed)
Patch Set: Set status for non connected networks. Created 10 years, 2 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/cros/cros_mock.cc
diff --git a/chrome/browser/chromeos/cros/cros_mock.cc b/chrome/browser/chromeos/cros/cros_mock.cc
index fcca7a7c4f0554890925a3b7678283ac37a68290..9761d9bd53f12cfa8ff625ad07683419f5215e05 100644
--- a/chrome/browser/chromeos/cros/cros_mock.cc
+++ b/chrome/browser/chromeos/cros/cros_mock.cc
@@ -271,15 +271,17 @@ void CrosMock::SetNetworkLibraryStatusAreaExpectations() {
EXPECT_CALL(*mock_network_library_, AddObserver(_))
.Times(1)
.RetiresOnSaturation();
- EXPECT_CALL(*mock_network_library_, wifi_connecting())
- .Times(1)
+
+ // NetworkDropdownButton::NetworkChanged() calls:
+ EXPECT_CALL(*mock_network_library_, ethernet_connected())
+ .Times(2) // also called by NetworkMenu::InitMenuItems()
.WillRepeatedly((Return(false)))
.RetiresOnSaturation();
EXPECT_CALL(*mock_network_library_, wifi_connected())
.Times(1)
.WillRepeatedly((Return(false)))
.RetiresOnSaturation();
- EXPECT_CALL(*mock_network_library_, cellular_connecting())
+ EXPECT_CALL(*mock_network_library_, wifi_connecting())
.Times(1)
.WillRepeatedly((Return(false)))
.RetiresOnSaturation();
@@ -287,18 +289,49 @@ void CrosMock::SetNetworkLibraryStatusAreaExpectations() {
.Times(1)
.WillRepeatedly((Return(false)))
.RetiresOnSaturation();
- EXPECT_CALL(*mock_network_library_, ethernet_connected())
+ EXPECT_CALL(*mock_network_library_, cellular_connecting())
.Times(1)
.WillRepeatedly((Return(false)))
.RetiresOnSaturation();
EXPECT_CALL(*mock_network_library_, Connected())
- .Times(1)
+ .Times(2) // also called by NetworkMenu::InitMenuItems()
.WillRepeatedly((Return(false)))
.RetiresOnSaturation();
EXPECT_CALL(*mock_network_library_, Connecting())
.Times(1)
.WillRepeatedly((Return(false)))
.RetiresOnSaturation();
+
+ // NetworkMenu::InitMenuItems() calls:
+ EXPECT_CALL(*mock_network_library_, ethernet_connecting())
+ .Times(1)
+ .WillRepeatedly((Return(false)))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*mock_network_library_, wifi_networks())
+ .Times(1)
+ .WillRepeatedly((ReturnRef(wifi_networks_)))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*mock_network_library_, wifi_available())
+ .Times(1)
+ .WillRepeatedly((Return(false)))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*mock_network_library_, wifi_name())
+ .Times(1)
+ .WillRepeatedly((ReturnRef(empty_string_)))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*mock_network_library_, cellular_networks())
+ .Times(1)
+ .WillRepeatedly((ReturnRef(cellular_networks_)))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*mock_network_library_, cellular_name())
+ .Times(1)
+ .WillRepeatedly((ReturnRef(empty_string_)))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*mock_network_library_, cellular_available())
+ .Times(1)
+ .WillRepeatedly((Return(false)))
+ .RetiresOnSaturation();
+
EXPECT_CALL(*mock_network_library_, RemoveObserver(_))
.Times(1)
.RetiresOnSaturation();

Powered by Google App Engine
This is Rietveld 408576698