| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // Redirect session_manager DBus calls to FakeSessionManagerClient. | 414 // Redirect session_manager DBus calls to FakeSessionManagerClient. |
| 415 chromeos::MockDBusThreadManager* dbus_thread_manager = | 415 chromeos::MockDBusThreadManager* dbus_thread_manager = |
| 416 new chromeos::MockDBusThreadManager(); | 416 new chromeos::MockDBusThreadManager(); |
| 417 EXPECT_CALL(*dbus_thread_manager, GetSessionManagerClient()) | 417 EXPECT_CALL(*dbus_thread_manager, GetSessionManagerClient()) |
| 418 .WillRepeatedly(Return(&session_manager_client_)); | 418 .WillRepeatedly(Return(&session_manager_client_)); |
| 419 chromeos::DBusThreadManager::InitializeForTesting(dbus_thread_manager); | 419 chromeos::DBusThreadManager::InitializeForTesting(dbus_thread_manager); |
| 420 | 420 |
| 421 // Mock out cryptohome mount calls to succeed immediately. | 421 // Mock out cryptohome mount calls to succeed immediately. |
| 422 EXPECT_CALL(*dbus_thread_manager, GetCryptohomeClient()) | 422 EXPECT_CALL(*dbus_thread_manager, GetCryptohomeClient()) |
| 423 .WillRepeatedly(Return(&cryptohome_client_)); | 423 .WillRepeatedly(Return(&cryptohome_client_)); |
| 424 | |
| 425 // Set up the MockUpdateEngineClient. | |
| 426 EXPECT_CALL(*dbus_thread_manager->mock_update_engine_client(), | |
| 427 GetLastStatus()) | |
| 428 .Times(1) | |
| 429 .WillOnce(Return(chromeos::MockUpdateEngineClient::Status())); | |
| 430 } | 424 } |
| 431 | 425 |
| 432 virtual void CleanUpOnMainThread() OVERRIDE { | 426 virtual void CleanUpOnMainThread() OVERRIDE { |
| 433 // This shuts down the login UI. | 427 // This shuts down the login UI. |
| 434 MessageLoop::current()->PostTask(FROM_HERE, | 428 MessageLoop::current()->PostTask(FROM_HERE, |
| 435 base::Bind(&chrome::AttemptExit)); | 429 base::Bind(&chrome::AttemptExit)); |
| 436 base::RunLoop().RunUntilIdle(); | 430 base::RunLoop().RunUntilIdle(); |
| 437 } | 431 } |
| 438 | 432 |
| 439 void SetUpInstallAttributes() { | 433 void SetUpInstallAttributes() { |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 627 |
| 634 TabStripModel* tabs = browser->tab_strip_model(); | 628 TabStripModel* tabs = browser->tab_strip_model(); |
| 635 ASSERT_TRUE(tabs); | 629 ASSERT_TRUE(tabs); |
| 636 int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); | 630 int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); |
| 637 EXPECT_EQ(expected_tab_count, tabs->count()); | 631 EXPECT_EQ(expected_tab_count, tabs->count()); |
| 638 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) | 632 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) |
| 639 EXPECT_EQ(GURL(kStartupURLs[i]), tabs->GetWebContentsAt(i)->GetURL()); | 633 EXPECT_EQ(GURL(kStartupURLs[i]), tabs->GetWebContentsAt(i)->GetURL()); |
| 640 } | 634 } |
| 641 | 635 |
| 642 } // namespace policy | 636 } // namespace policy |
| OLD | NEW |