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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/cros/cros_mock.h" 5 #include "chrome/browser/chromeos/cros/cros_mock.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/ref_counted.h" 8 #include "base/ref_counted.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "chrome/browser/browser.h" 10 #include "chrome/browser/browser.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 .RetiresOnSaturation(); 264 .RetiresOnSaturation();
265 EXPECT_CALL(*mock_input_method_library_, StopInputMethodProcesses()) 265 EXPECT_CALL(*mock_input_method_library_, StopInputMethodProcesses())
266 .Times(AnyNumber()) 266 .Times(AnyNumber())
267 .RetiresOnSaturation(); 267 .RetiresOnSaturation();
268 } 268 }
269 269
270 void CrosMock::SetNetworkLibraryStatusAreaExpectations() { 270 void CrosMock::SetNetworkLibraryStatusAreaExpectations() {
271 EXPECT_CALL(*mock_network_library_, AddObserver(_)) 271 EXPECT_CALL(*mock_network_library_, AddObserver(_))
272 .Times(1) 272 .Times(1)
273 .RetiresOnSaturation(); 273 .RetiresOnSaturation();
274 EXPECT_CALL(*mock_network_library_, wifi_connecting()) 274
275 .Times(1) 275 // NetworkDropdownButton::NetworkChanged() calls:
276 EXPECT_CALL(*mock_network_library_, ethernet_connected())
277 .Times(2) // also called by NetworkMenu::InitMenuItems()
276 .WillRepeatedly((Return(false))) 278 .WillRepeatedly((Return(false)))
277 .RetiresOnSaturation(); 279 .RetiresOnSaturation();
278 EXPECT_CALL(*mock_network_library_, wifi_connected()) 280 EXPECT_CALL(*mock_network_library_, wifi_connected())
279 .Times(1) 281 .Times(1)
280 .WillRepeatedly((Return(false))) 282 .WillRepeatedly((Return(false)))
281 .RetiresOnSaturation(); 283 .RetiresOnSaturation();
282 EXPECT_CALL(*mock_network_library_, cellular_connecting()) 284 EXPECT_CALL(*mock_network_library_, wifi_connecting())
283 .Times(1) 285 .Times(1)
284 .WillRepeatedly((Return(false))) 286 .WillRepeatedly((Return(false)))
285 .RetiresOnSaturation(); 287 .RetiresOnSaturation();
286 EXPECT_CALL(*mock_network_library_, cellular_connected()) 288 EXPECT_CALL(*mock_network_library_, cellular_connected())
287 .Times(1) 289 .Times(1)
288 .WillRepeatedly((Return(false))) 290 .WillRepeatedly((Return(false)))
289 .RetiresOnSaturation(); 291 .RetiresOnSaturation();
290 EXPECT_CALL(*mock_network_library_, ethernet_connected()) 292 EXPECT_CALL(*mock_network_library_, cellular_connecting())
291 .Times(1) 293 .Times(1)
292 .WillRepeatedly((Return(false))) 294 .WillRepeatedly((Return(false)))
293 .RetiresOnSaturation(); 295 .RetiresOnSaturation();
294 EXPECT_CALL(*mock_network_library_, Connected()) 296 EXPECT_CALL(*mock_network_library_, Connected())
295 .Times(1) 297 .Times(2) // also called by NetworkMenu::InitMenuItems()
296 .WillRepeatedly((Return(false))) 298 .WillRepeatedly((Return(false)))
297 .RetiresOnSaturation(); 299 .RetiresOnSaturation();
298 EXPECT_CALL(*mock_network_library_, Connecting()) 300 EXPECT_CALL(*mock_network_library_, Connecting())
299 .Times(1) 301 .Times(1)
300 .WillRepeatedly((Return(false))) 302 .WillRepeatedly((Return(false)))
301 .RetiresOnSaturation(); 303 .RetiresOnSaturation();
304
305 // NetworkMenu::InitMenuItems() calls:
306 EXPECT_CALL(*mock_network_library_, ethernet_connecting())
307 .Times(1)
308 .WillRepeatedly((Return(false)))
309 .RetiresOnSaturation();
310 EXPECT_CALL(*mock_network_library_, wifi_networks())
311 .Times(1)
312 .WillRepeatedly((ReturnRef(wifi_networks_)))
313 .RetiresOnSaturation();
314 EXPECT_CALL(*mock_network_library_, wifi_available())
315 .Times(1)
316 .WillRepeatedly((Return(false)))
317 .RetiresOnSaturation();
318 EXPECT_CALL(*mock_network_library_, wifi_name())
319 .Times(1)
320 .WillRepeatedly((ReturnRef(empty_string_)))
321 .RetiresOnSaturation();
322 EXPECT_CALL(*mock_network_library_, cellular_networks())
323 .Times(1)
324 .WillRepeatedly((ReturnRef(cellular_networks_)))
325 .RetiresOnSaturation();
326 EXPECT_CALL(*mock_network_library_, cellular_name())
327 .Times(1)
328 .WillRepeatedly((ReturnRef(empty_string_)))
329 .RetiresOnSaturation();
330 EXPECT_CALL(*mock_network_library_, cellular_available())
331 .Times(1)
332 .WillRepeatedly((Return(false)))
333 .RetiresOnSaturation();
334
302 EXPECT_CALL(*mock_network_library_, RemoveObserver(_)) 335 EXPECT_CALL(*mock_network_library_, RemoveObserver(_))
303 .Times(1) 336 .Times(1)
304 .RetiresOnSaturation(); 337 .RetiresOnSaturation();
305 } 338 }
306 339
307 void CrosMock::SetPowerLibraryStatusAreaExpectations() { 340 void CrosMock::SetPowerLibraryStatusAreaExpectations() {
308 EXPECT_CALL(*mock_power_library_, AddObserver(_)) 341 EXPECT_CALL(*mock_power_library_, AddObserver(_))
309 .Times(1) 342 .Times(1)
310 .RetiresOnSaturation(); 343 .RetiresOnSaturation();
311 EXPECT_CALL(*mock_power_library_, battery_fully_charged()) 344 EXPECT_CALL(*mock_power_library_, battery_fully_charged())
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 test_api()->SetScreenLockLibrary(NULL, false); 436 test_api()->SetScreenLockLibrary(NULL, false);
404 if (mock_speech_synthesis_library_) 437 if (mock_speech_synthesis_library_)
405 test_api()->SetSpeechSynthesisLibrary(NULL, false); 438 test_api()->SetSpeechSynthesisLibrary(NULL, false);
406 if (mock_system_library_) 439 if (mock_system_library_)
407 test_api()->SetSystemLibrary(NULL, false); 440 test_api()->SetSystemLibrary(NULL, false);
408 if (mock_touchpad_library_) 441 if (mock_touchpad_library_)
409 test_api()->SetTouchpadLibrary(NULL, false); 442 test_api()->SetTouchpadLibrary(NULL, false);
410 } 443 }
411 444
412 } // namespace chromeos 445 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698