OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 // Overwrite the Setup function to enable multi profile and needed objects. | 779 // Overwrite the Setup function to enable multi profile and needed objects. |
780 virtual void SetUp() OVERRIDE { | 780 virtual void SetUp() OVERRIDE { |
781 profile_manager_.reset( | 781 profile_manager_.reset( |
782 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); | 782 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); |
783 | 783 |
784 ASSERT_TRUE(profile_manager_->SetUp()); | 784 ASSERT_TRUE(profile_manager_->SetUp()); |
785 | 785 |
786 // AvatarMenu and multiple profiles works after user logged in. | 786 // AvatarMenu and multiple profiles works after user logged in. |
787 profile_manager_->SetLoggedIn(true); | 787 profile_manager_->SetLoggedIn(true); |
788 | 788 |
789 // Enabling multi profile requires several flags to be set. | |
790 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kMultiProfiles); | |
791 | |
792 // Initialize the UserManager singleton to a fresh FakeUserManager instance. | 789 // Initialize the UserManager singleton to a fresh FakeUserManager instance. |
793 user_manager_enabler_.reset( | 790 user_manager_enabler_.reset( |
794 new chromeos::ScopedUserManagerEnabler(new chromeos::FakeUserManager)); | 791 new chromeos::ScopedUserManagerEnabler(new chromeos::FakeUserManager)); |
795 | 792 |
796 // Initialize the rest. | 793 // Initialize the rest. |
797 ChromeLauncherControllerTest::SetUp(); | 794 ChromeLauncherControllerTest::SetUp(); |
798 | 795 |
799 // Get some base objects. | 796 // Get some base objects. |
800 session_delegate()->set_logged_in_users(2); | 797 session_delegate()->set_logged_in_users(2); |
801 shell_delegate_ = static_cast<ash::test::TestShellDelegate*>( | 798 shell_delegate_ = static_cast<ash::test::TestShellDelegate*>( |
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2693 | 2690 |
2694 EXPECT_EQ(1, app_icon_loader->fetch_count()); | 2691 EXPECT_EQ(1, app_icon_loader->fetch_count()); |
2695 ASSERT_EQ(initial_size + 1, model_->items().size()); | 2692 ASSERT_EQ(initial_size + 1, model_->items().size()); |
2696 EXPECT_TRUE(launcher_controller_->IsAppPinned("1")); | 2693 EXPECT_TRUE(launcher_controller_->IsAppPinned("1")); |
2697 EXPECT_FALSE(launcher_controller_->IsAppPinned("0")); | 2694 EXPECT_FALSE(launcher_controller_->IsAppPinned("0")); |
2698 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type); | 2695 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type); |
2699 | 2696 |
2700 launcher_controller_->UnpinAppWithID("1"); | 2697 launcher_controller_->UnpinAppWithID("1"); |
2701 ASSERT_EQ(initial_size, model_->items().size()); | 2698 ASSERT_EQ(initial_size, model_->items().size()); |
2702 } | 2699 } |
OLD | NEW |