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 "chrome/browser/chromeos/customization_document.h" | 5 #include "chrome/browser/chromeos/customization_document.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/prefs/testing_pref_service.h" | 8 #include "base/prefs/testing_pref_service.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 ServicesCustomizationDocument::InitializeForTesting(); | 222 ServicesCustomizationDocument::InitializeForTesting(); |
223 | 223 |
224 EXPECT_CALL(mock_statistics_provider_, GetMachineStatistic(_, NotNull())) | 224 EXPECT_CALL(mock_statistics_provider_, GetMachineStatistic(_, NotNull())) |
225 .WillRepeatedly(Return(false)); | 225 .WillRepeatedly(Return(false)); |
226 chromeos::system::StatisticsProvider::SetTestProvider( | 226 chromeos::system::StatisticsProvider::SetTestProvider( |
227 &mock_statistics_provider_); | 227 &mock_statistics_provider_); |
228 | 228 |
229 DBusThreadManager::InitializeWithStub(); | 229 DBusThreadManager::InitializeWithStub(); |
230 NetworkHandler::Initialize(); | 230 NetworkHandler::Initialize(); |
231 RunUntilIdle(); | 231 RunUntilIdle(); |
| 232 const NetworkState* default_network = |
| 233 NetworkHandler::Get()->network_state_handler()->DefaultNetwork(); |
232 std::string default_network_path = | 234 std::string default_network_path = |
233 NetworkHandler::Get()->network_state_handler()->default_network_path(); | 235 default_network ? default_network->path() : ""; |
234 | 236 |
235 NetworkPortalDetector::InitializeForTesting(&network_portal_detector_); | 237 NetworkPortalDetector::InitializeForTesting(&network_portal_detector_); |
236 NetworkPortalDetector::CaptivePortalState online_state; | 238 NetworkPortalDetector::CaptivePortalState online_state; |
237 online_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; | 239 online_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; |
238 online_state.response_code = 204; | 240 online_state.response_code = 204; |
239 network_portal_detector_.SetDefaultNetworkPathForTesting( | 241 network_portal_detector_.SetDefaultNetworkPathForTesting( |
240 default_network_path); | 242 default_network_path, |
| 243 default_network ? default_network->guid() : ""); |
241 network_portal_detector_.SetDetectionResultsForTesting( | 244 network_portal_detector_.SetDetectionResultsForTesting( |
242 default_network_path, online_state); | 245 default_network_path, online_state); |
243 | 246 |
244 TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_); | 247 TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_); |
245 ServicesCustomizationDocument::RegisterPrefs(local_state_.registry()); | 248 ServicesCustomizationDocument::RegisterPrefs(local_state_.registry()); |
246 } | 249 } |
247 | 250 |
248 virtual void TearDown() OVERRIDE { | 251 virtual void TearDown() OVERRIDE { |
249 TestingBrowserProcess::GetGlobal()->SetLocalState(NULL); | 252 TestingBrowserProcess::GetGlobal()->SetLocalState(NULL); |
250 NetworkHandler::Shutdown(); | 253 NetworkHandler::Shutdown(); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _)) | 474 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _)) |
472 .Times(0); | 475 .Times(0); |
473 EXPECT_CALL(visitor, OnExternalProviderReady(_)) | 476 EXPECT_CALL(visitor, OnExternalProviderReady(_)) |
474 .Times(1); | 477 .Times(1); |
475 | 478 |
476 RunUntilIdle(); | 479 RunUntilIdle(); |
477 EXPECT_TRUE(doc->IsReady()); | 480 EXPECT_TRUE(doc->IsReady()); |
478 } | 481 } |
479 | 482 |
480 } // namespace chromeos | 483 } // namespace chromeos |
OLD | NEW |