| 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/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/chromeos/login/login_status_consumer.h" | 21 #include "chrome/browser/chromeos/login/login_status_consumer.h" |
| 22 #include "chrome/browser/chromeos/login/user_manager.h" | 22 #include "chrome/browser/chromeos/login/user_manager.h" |
| 23 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" | 23 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" |
| 24 #include "chrome/browser/io_thread.h" | 24 #include "chrome/browser/io_thread.h" |
| 25 #include "chrome/browser/net/predictor.h" | 25 #include "chrome/browser/net/predictor.h" |
| 26 #include "chrome/browser/policy/browser_policy_connector.h" | 26 #include "chrome/browser/policy/browser_policy_connector.h" |
| 27 #include "chrome/browser/policy/cloud_policy_data_store.h" | 27 #include "chrome/browser/policy/cloud_policy_data_store.h" |
| 28 #include "chrome/browser/policy/policy_service.h" | 28 #include "chrome/browser/policy/policy_service.h" |
| 29 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 29 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
| 30 #include "chrome/browser/profiles/profile_manager.h" | 30 #include "chrome/browser/profiles/profile_manager.h" |
| 31 #include "chrome/browser/rlz/rlz.h" |
| 31 #include "chrome/common/chrome_notification_types.h" | 32 #include "chrome/common/chrome_notification_types.h" |
| 32 #include "chrome/common/chrome_paths.h" | 33 #include "chrome/common/chrome_paths.h" |
| 33 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
| 34 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
| 35 #include "chrome/test/base/testing_browser_process.h" | 36 #include "chrome/test/base/testing_browser_process.h" |
| 36 #include "chrome/test/base/testing_pref_service.h" | 37 #include "chrome/test/base/testing_pref_service.h" |
| 37 #include "chromeos/cryptohome/mock_async_method_caller.h" | 38 #include "chromeos/cryptohome/mock_async_method_caller.h" |
| 38 #include "chromeos/dbus/mock_cryptohome_client.h" | 39 #include "chromeos/dbus/mock_cryptohome_client.h" |
| 39 #include "chromeos/dbus/mock_dbus_thread_manager.h" | 40 #include "chromeos/dbus/mock_dbus_thread_manager.h" |
| 40 #include "chromeos/dbus/mock_session_manager_client.h" | 41 #include "chromeos/dbus/mock_session_manager_client.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 connector_ = browser_process_->browser_policy_connector(); | 264 connector_ = browser_process_->browser_policy_connector(); |
| 264 connector_->Init(); | 265 connector_->Init(); |
| 265 | 266 |
| 266 RunUntilIdle(); | 267 RunUntilIdle(); |
| 267 } | 268 } |
| 268 | 269 |
| 269 virtual void TearDown() OVERRIDE { | 270 virtual void TearDown() OVERRIDE { |
| 270 cryptohome::AsyncMethodCaller::Shutdown(); | 271 cryptohome::AsyncMethodCaller::Shutdown(); |
| 271 mock_async_method_caller_ = NULL; | 272 mock_async_method_caller_ = NULL; |
| 272 | 273 |
| 274 #if defined(ENABLE_RLZ) |
| 275 RLZTracker::CleanupRlz(); |
| 276 #endif |
| 277 |
| 273 InvokeOnIO( | 278 InvokeOnIO( |
| 274 base::Bind(&LoginUtilsTest::TearDownOnIO, base::Unretained(this))); | 279 base::Bind(&LoginUtilsTest::TearDownOnIO, base::Unretained(this))); |
| 275 | 280 |
| 276 // These trigger some tasks that have to run while BrowserThread::UI | 281 // These trigger some tasks that have to run while BrowserThread::UI |
| 277 // exists. Delete all the profiles before deleting the connector. | 282 // exists. Delete all the profiles before deleting the connector. |
| 278 browser_process_->SetProfileManager(NULL); | 283 browser_process_->SetProfileManager(NULL); |
| 279 connector_ = NULL; | 284 connector_ = NULL; |
| 280 browser_process_->SetBrowserPolicyConnector(NULL); | 285 browser_process_->SetBrowserPolicyConnector(NULL); |
| 281 QuitIOLoop(); | 286 QuitIOLoop(); |
| 282 RunUntilIdle(); | 287 RunUntilIdle(); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 } | 660 } |
| 656 | 661 |
| 657 INSTANTIATE_TEST_CASE_P( | 662 INSTANTIATE_TEST_CASE_P( |
| 658 LoginUtilsBlockingLoginTestInstance, | 663 LoginUtilsBlockingLoginTestInstance, |
| 659 LoginUtilsBlockingLoginTest, | 664 LoginUtilsBlockingLoginTest, |
| 660 testing::Values(0, 1, 2, 3, 4, 5)); | 665 testing::Values(0, 1, 2, 3, 4, 5)); |
| 661 | 666 |
| 662 } // namespace | 667 } // namespace |
| 663 | 668 |
| 664 } | 669 } |
| OLD | NEW |