OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/chromeos/cros/mock_network_library.h" | 10 #include "chrome/browser/chromeos/cros/mock_network_library.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 .Times(AnyNumber()) | 148 .Times(AnyNumber()) |
149 .WillRepeatedly((Return(false))); | 149 .WillRepeatedly((Return(false))); |
150 EXPECT_CALL(*mock_network_library_, wifi_scanning()) | 150 EXPECT_CALL(*mock_network_library_, wifi_scanning()) |
151 .Times(AnyNumber()) | 151 .Times(AnyNumber()) |
152 .WillRepeatedly((Return(false))); | 152 .WillRepeatedly((Return(false))); |
153 EXPECT_CALL(*mock_network_library_, cellular_initializing()) | 153 EXPECT_CALL(*mock_network_library_, cellular_initializing()) |
154 .Times(AnyNumber()) | 154 .Times(AnyNumber()) |
155 .WillRepeatedly((Return(false))); | 155 .WillRepeatedly((Return(false))); |
156 EXPECT_CALL(*mock_network_library_, AddUserActionObserver(_)) | 156 EXPECT_CALL(*mock_network_library_, AddUserActionObserver(_)) |
157 .Times(AnyNumber()); | 157 .Times(AnyNumber()); |
158 EXPECT_CALL(*mock_network_library_, LoadOncNetworks(_, _)) | 158 EXPECT_CALL(*mock_network_library_, LoadOncNetworks(_, _, _)) |
159 .Times(AnyNumber()); | 159 .Times(AnyNumber()); |
160 | 160 |
161 // Set specific expectations for interesting functions: | 161 // Set specific expectations for interesting functions: |
162 | 162 |
163 // NetworkMenuButton::OnNetworkChanged() calls: | 163 // NetworkMenuButton::OnNetworkChanged() calls: |
164 EXPECT_CALL(*mock_network_library_, Connected()) | 164 EXPECT_CALL(*mock_network_library_, Connected()) |
165 .Times(AnyNumber()) | 165 .Times(AnyNumber()) |
166 .WillRepeatedly((Return(false))) | 166 .WillRepeatedly((Return(false))) |
167 .RetiresOnSaturation(); | 167 .RetiresOnSaturation(); |
168 EXPECT_CALL(*mock_network_library_, Connecting()) | 168 EXPECT_CALL(*mock_network_library_, Connecting()) |
(...skipping 16 matching lines...) Expand all Loading... |
185 .RetiresOnSaturation(); | 185 .RetiresOnSaturation(); |
186 } | 186 } |
187 | 187 |
188 void CrosMock::TearDownMocks() { | 188 void CrosMock::TearDownMocks() { |
189 // Prevent bogus gMock leak check from firing. | 189 // Prevent bogus gMock leak check from firing. |
190 if (mock_network_library_) | 190 if (mock_network_library_) |
191 test_api()->SetNetworkLibrary(NULL, false); | 191 test_api()->SetNetworkLibrary(NULL, false); |
192 } | 192 } |
193 | 193 |
194 } // namespace chromeos | 194 } // namespace chromeos |
OLD | NEW |