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(1) | 278 .Times(2) // also called by NetworkMenu::InitMenuItems() |
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(1) | 298 .Times(2) // also called by NetworkMenu::InitMenuItems() |
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()) | 307 EXPECT_CALL(*mock_network_library_, ethernet_connecting()) |
308 .Times(1) | |
309 .WillRepeatedly((Return(true))) | |
310 .RetiresOnSaturation(); | |
311 EXPECT_CALL(*mock_network_library_, ethernet_connected()) | |
312 .Times(1) | 308 .Times(1) |
313 .WillRepeatedly((Return(false))) | 309 .WillRepeatedly((Return(false))) |
314 .RetiresOnSaturation(); | 310 .RetiresOnSaturation(); |
315 EXPECT_CALL(*mock_network_library_, ethernet_connecting()) | 311 EXPECT_CALL(*mock_network_library_, wifi_networks()) |
316 .Times(1) | 312 .Times(1) |
317 .WillRepeatedly((Return(false))) | 313 .WillRepeatedly((ReturnRef(wifi_networks_))) |
318 .RetiresOnSaturation(); | 314 .RetiresOnSaturation(); |
319 EXPECT_CALL(*mock_network_library_, wifi_available()) | 315 EXPECT_CALL(*mock_network_library_, wifi_available()) |
320 .Times(1) | 316 .Times(1) |
321 .WillRepeatedly((Return(false))) | 317 .WillRepeatedly((Return(false))) |
322 .RetiresOnSaturation(); | 318 .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(); |
323 EXPECT_CALL(*mock_network_library_, cellular_available()) | 331 EXPECT_CALL(*mock_network_library_, cellular_available()) |
324 .Times(1) | 332 .Times(1) |
325 .WillRepeatedly((Return(false))) | 333 .WillRepeatedly((Return(false))) |
326 .RetiresOnSaturation(); | 334 .RetiresOnSaturation(); |
327 | 335 |
328 EXPECT_CALL(*mock_network_library_, RemoveObserver(_)) | 336 EXPECT_CALL(*mock_network_library_, RemoveObserver(_)) |
329 .Times(1) | 337 .Times(1) |
330 .RetiresOnSaturation(); | 338 .RetiresOnSaturation(); |
331 } | 339 } |
332 | 340 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 test_api()->SetScreenLockLibrary(NULL, false); | 440 test_api()->SetScreenLockLibrary(NULL, false); |
433 if (mock_speech_synthesis_library_) | 441 if (mock_speech_synthesis_library_) |
434 test_api()->SetSpeechSynthesisLibrary(NULL, false); | 442 test_api()->SetSpeechSynthesisLibrary(NULL, false); |
435 if (mock_system_library_) | 443 if (mock_system_library_) |
436 test_api()->SetSystemLibrary(NULL, false); | 444 test_api()->SetSystemLibrary(NULL, false); |
437 if (mock_touchpad_library_) | 445 if (mock_touchpad_library_) |
438 test_api()->SetTouchpadLibrary(NULL, false); | 446 test_api()->SetTouchpadLibrary(NULL, false); |
439 } | 447 } |
440 | 448 |
441 } // namespace chromeos | 449 } // namespace chromeos |
OLD | NEW |