OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/chromeos/cros/cros_library.h" | 12 #include "chrome/browser/chromeos/cros/cros_library.h" |
13 #include "chrome/browser/chromeos/cros/mock_login_library.h" | 13 #include "chrome/browser/chromeos/cros/mock_login_library.h" |
14 #include "chrome/browser/chromeos/cros/mock_network_library.h" | 14 #include "chrome/browser/chromeos/cros/mock_network_library.h" |
15 #include "chrome/browser/chromeos/cros/network_library.h" | 15 #include "chrome/browser/chromeos/cros/network_library.h" |
16 #include "chrome/browser/chromeos/login/mock_screen_observer.h" | 16 #include "chrome/browser/chromeos/login/mock_screen_observer.h" |
17 #include "chrome/browser/chromeos/login/network_screen.h" | 17 #include "chrome/browser/chromeos/login/network_screen.h" |
18 #include "chrome/browser/chromeos/login/network_selection_view.h" | 18 #include "chrome/browser/chromeos/login/network_selection_view.h" |
19 #include "chrome/browser/chromeos/login/view_screen.h" | 19 #include "chrome/browser/chromeos/login/view_screen.h" |
20 #include "chrome/browser/chromeos/login/wizard_controller.h" | 20 #include "chrome/browser/chromeos/login/wizard_controller.h" |
21 #include "chrome/browser/chromeos/login/wizard_in_process_browser_test.h" | 21 #include "chrome/browser/chromeos/login/wizard_in_process_browser_test.h" |
22 #include "chrome/browser/chromeos/login/wizard_screen.h" | 22 #include "chrome/browser/chromeos/login/wizard_screen.h" |
23 #include "chrome/test/ui_test_utils.h" | 23 #include "chrome/test/ui_test_utils.h" |
24 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 25 #include "testing/gmock/include/gmock/gmock-actions.h" |
25 #include "testing/gmock/include/gmock/gmock.h" | 26 #include "testing/gmock/include/gmock/gmock.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
27 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
28 #include "views/controls/button/text_button.h" | 29 #include "views/controls/button/text_button.h" |
29 | 30 |
30 namespace chromeos { | 31 namespace chromeos { |
31 using ::testing::AnyNumber; | 32 using ::testing::AnyNumber; |
32 using ::testing::InvokeWithoutArgs; | 33 using ::testing::InvokeWithoutArgs; |
33 using ::testing::Return; | 34 using ::testing::Return; |
34 using ::testing::ReturnRef; | 35 using ::testing::ReturnRef; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 .WillRepeatedly(Return(false)); | 70 .WillRepeatedly(Return(false)); |
70 EXPECT_CALL(*mock_network_library_, ethernet_connecting()) | 71 EXPECT_CALL(*mock_network_library_, ethernet_connecting()) |
71 .Times(2) | 72 .Times(2) |
72 .WillRepeatedly(Return(false)); | 73 .WillRepeatedly(Return(false)); |
73 EXPECT_CALL(*mock_network_library_, wifi_connected()) | 74 EXPECT_CALL(*mock_network_library_, wifi_connected()) |
74 .Times(1) | 75 .Times(1) |
75 .WillRepeatedly(Return(false)); | 76 .WillRepeatedly(Return(false)); |
76 EXPECT_CALL(*mock_network_library_, cellular_connected()) | 77 EXPECT_CALL(*mock_network_library_, cellular_connected()) |
77 .Times(1) | 78 .Times(1) |
78 .WillRepeatedly(Return(false)); | 79 .WillRepeatedly(Return(false)); |
| 80 EXPECT_CALL(*mock_network_library_, FindWifiDevices()) |
| 81 .WillRepeatedly((Return(NetworkDeviceVector()))); |
| 82 EXPECT_CALL(*mock_network_library_, FindEthernetDevices()) |
| 83 .WillRepeatedly((Return(NetworkDeviceVector()))); |
79 | 84 |
80 cros_mock_->SetStatusAreaMocksExpectations(); | 85 cros_mock_->SetStatusAreaMocksExpectations(); |
81 | 86 |
82 // Override these return values, but do not set specific expectation: | 87 // Override these return values, but do not set specific expectation: |
83 EXPECT_CALL(*mock_network_library_, wifi_available()) | 88 EXPECT_CALL(*mock_network_library_, wifi_available()) |
84 .Times(AnyNumber()) | 89 .Times(AnyNumber()) |
85 .WillRepeatedly((Return(true))); | 90 .WillRepeatedly((Return(true))); |
86 EXPECT_CALL(*mock_network_library_, wifi_enabled()) | 91 EXPECT_CALL(*mock_network_library_, wifi_enabled()) |
87 .Times(AnyNumber()) | 92 .Times(AnyNumber()) |
88 .WillRepeatedly((Return(true))); | 93 .WillRepeatedly((Return(true))); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 EXPECT_FALSE(network_view->IsConnecting()); | 291 EXPECT_FALSE(network_view->IsConnecting()); |
287 network_screen->OnConnectionTimeout(); | 292 network_screen->OnConnectionTimeout(); |
288 | 293 |
289 // Close infobubble with error message - it makes the test stable. | 294 // Close infobubble with error message - it makes the test stable. |
290 EXPECT_FALSE(network_view->IsContinueEnabled()); | 295 EXPECT_FALSE(network_view->IsContinueEnabled()); |
291 EXPECT_FALSE(network_view->IsConnecting()); | 296 EXPECT_FALSE(network_view->IsConnecting()); |
292 network_screen->ClearErrors(); | 297 network_screen->ClearErrors(); |
293 } | 298 } |
294 | 299 |
295 } // namespace chromeos | 300 } // namespace chromeos |
OLD | NEW |