OLD | NEW |
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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 .RetiresOnSaturation(); | 268 .RetiresOnSaturation(); |
269 } | 269 } |
270 | 270 |
271 void CrosMock::SetNetworkLibraryStatusAreaExpectations() { | 271 void CrosMock::SetNetworkLibraryStatusAreaExpectations() { |
272 EXPECT_CALL(*mock_network_library_, AddObserver(_)) | 272 EXPECT_CALL(*mock_network_library_, AddObserver(_)) |
273 .Times(1) | 273 .Times(1) |
274 .RetiresOnSaturation(); | 274 .RetiresOnSaturation(); |
275 | 275 |
276 // NetworkDropdownButton::NetworkChanged() calls: | 276 // NetworkDropdownButton::NetworkChanged() calls: |
277 EXPECT_CALL(*mock_network_library_, ethernet_connected()) | 277 EXPECT_CALL(*mock_network_library_, ethernet_connected()) |
278 .Times(2) // also called by NetworkMenu::InitMenuItems() | 278 .Times(1) |
279 .WillRepeatedly((Return(false))) | 279 .WillRepeatedly((Return(false))) |
280 .RetiresOnSaturation(); | 280 .RetiresOnSaturation(); |
281 EXPECT_CALL(*mock_network_library_, wifi_connected()) | 281 EXPECT_CALL(*mock_network_library_, wifi_connected()) |
282 .Times(1) | 282 .Times(1) |
283 .WillRepeatedly((Return(false))) | 283 .WillRepeatedly((Return(false))) |
284 .RetiresOnSaturation(); | 284 .RetiresOnSaturation(); |
285 EXPECT_CALL(*mock_network_library_, wifi_connecting()) | 285 EXPECT_CALL(*mock_network_library_, wifi_connecting()) |
286 .Times(1) | 286 .Times(1) |
287 .WillRepeatedly((Return(false))) | 287 .WillRepeatedly((Return(false))) |
288 .RetiresOnSaturation(); | 288 .RetiresOnSaturation(); |
289 EXPECT_CALL(*mock_network_library_, cellular_connected()) | 289 EXPECT_CALL(*mock_network_library_, cellular_connected()) |
290 .Times(1) | 290 .Times(1) |
291 .WillRepeatedly((Return(false))) | 291 .WillRepeatedly((Return(false))) |
292 .RetiresOnSaturation(); | 292 .RetiresOnSaturation(); |
293 EXPECT_CALL(*mock_network_library_, cellular_connecting()) | 293 EXPECT_CALL(*mock_network_library_, cellular_connecting()) |
294 .Times(1) | 294 .Times(1) |
295 .WillRepeatedly((Return(false))) | 295 .WillRepeatedly((Return(false))) |
296 .RetiresOnSaturation(); | 296 .RetiresOnSaturation(); |
297 EXPECT_CALL(*mock_network_library_, Connected()) | 297 EXPECT_CALL(*mock_network_library_, Connected()) |
298 .Times(2) // also called by NetworkMenu::InitMenuItems() | 298 .Times(1) |
299 .WillRepeatedly((Return(false))) | 299 .WillRepeatedly((Return(false))) |
300 .RetiresOnSaturation(); | 300 .RetiresOnSaturation(); |
301 EXPECT_CALL(*mock_network_library_, Connecting()) | 301 EXPECT_CALL(*mock_network_library_, Connecting()) |
302 .Times(1) | 302 .Times(1) |
303 .WillRepeatedly((Return(false))) | 303 .WillRepeatedly((Return(false))) |
304 .RetiresOnSaturation(); | 304 .RetiresOnSaturation(); |
305 | 305 |
306 // NetworkMenu::InitMenuItems() calls: | 306 // NetworkMenu::InitMenuItems() calls: |
| 307 EXPECT_CALL(*mock_network_library_, ethernet_available()) |
| 308 .Times(1) |
| 309 .WillRepeatedly((Return(true))) |
| 310 .RetiresOnSaturation(); |
| 311 EXPECT_CALL(*mock_network_library_, ethernet_connected()) |
| 312 .Times(1) |
| 313 .WillRepeatedly((Return(false))) |
| 314 .RetiresOnSaturation(); |
307 EXPECT_CALL(*mock_network_library_, ethernet_connecting()) | 315 EXPECT_CALL(*mock_network_library_, ethernet_connecting()) |
308 .Times(1) | 316 .Times(1) |
309 .WillRepeatedly((Return(false))) | 317 .WillRepeatedly((Return(false))) |
310 .RetiresOnSaturation(); | 318 .RetiresOnSaturation(); |
311 EXPECT_CALL(*mock_network_library_, wifi_networks()) | |
312 .Times(1) | |
313 .WillRepeatedly((ReturnRef(wifi_networks_))) | |
314 .RetiresOnSaturation(); | |
315 EXPECT_CALL(*mock_network_library_, wifi_available()) | 319 EXPECT_CALL(*mock_network_library_, wifi_available()) |
316 .Times(1) | 320 .Times(1) |
317 .WillRepeatedly((Return(false))) | 321 .WillRepeatedly((Return(false))) |
318 .RetiresOnSaturation(); | 322 .RetiresOnSaturation(); |
319 EXPECT_CALL(*mock_network_library_, wifi_network()) | |
320 .Times(1) | |
321 .WillRepeatedly((ReturnRef(wifi_network_))) | |
322 .RetiresOnSaturation(); | |
323 EXPECT_CALL(*mock_network_library_, cellular_networks()) | |
324 .Times(1) | |
325 .WillRepeatedly((ReturnRef(cellular_networks_))) | |
326 .RetiresOnSaturation(); | |
327 EXPECT_CALL(*mock_network_library_, cellular_network()) | |
328 .Times(1) | |
329 .WillRepeatedly((ReturnRef(cellular_network_))) | |
330 .RetiresOnSaturation(); | |
331 EXPECT_CALL(*mock_network_library_, cellular_available()) | 323 EXPECT_CALL(*mock_network_library_, cellular_available()) |
332 .Times(1) | 324 .Times(1) |
333 .WillRepeatedly((Return(false))) | 325 .WillRepeatedly((Return(false))) |
334 .RetiresOnSaturation(); | 326 .RetiresOnSaturation(); |
335 | 327 |
336 EXPECT_CALL(*mock_network_library_, RemoveObserver(_)) | 328 EXPECT_CALL(*mock_network_library_, RemoveObserver(_)) |
337 .Times(1) | 329 .Times(1) |
338 .RetiresOnSaturation(); | 330 .RetiresOnSaturation(); |
339 } | 331 } |
340 | 332 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 test_api()->SetScreenLockLibrary(NULL, false); | 432 test_api()->SetScreenLockLibrary(NULL, false); |
441 if (mock_speech_synthesis_library_) | 433 if (mock_speech_synthesis_library_) |
442 test_api()->SetSpeechSynthesisLibrary(NULL, false); | 434 test_api()->SetSpeechSynthesisLibrary(NULL, false); |
443 if (mock_system_library_) | 435 if (mock_system_library_) |
444 test_api()->SetSystemLibrary(NULL, false); | 436 test_api()->SetSystemLibrary(NULL, false); |
445 if (mock_touchpad_library_) | 437 if (mock_touchpad_library_) |
446 test_api()->SetTouchpadLibrary(NULL, false); | 438 test_api()->SetTouchpadLibrary(NULL, false); |
447 } | 439 } |
448 | 440 |
449 } // namespace chromeos | 441 } // namespace chromeos |
OLD | NEW |