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 <objbase.h> // For CoInitialize(). | 5 #include <objbase.h> // For CoInitialize(). |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 profile_info_cache_(NULL), | 37 profile_info_cache_(NULL), |
38 fake_user_desktop_(base::DIR_USER_DESKTOP) { | 38 fake_user_desktop_(base::DIR_USER_DESKTOP) { |
39 } | 39 } |
40 | 40 |
41 virtual void SetUp() OVERRIDE { | 41 virtual void SetUp() OVERRIDE { |
42 CoInitialize(NULL); | 42 CoInitialize(NULL); |
43 distribution_ = BrowserDistribution::GetDistribution(); | 43 distribution_ = BrowserDistribution::GetDistribution(); |
44 ASSERT_TRUE(distribution_ != NULL); | 44 ASSERT_TRUE(distribution_ != NULL); |
45 | 45 |
46 TestingBrowserProcess* browser_process = | 46 TestingBrowserProcess* browser_process = |
47 static_cast<TestingBrowserProcess*>(g_browser_process); | 47 TestingBrowserProcess::GetGlobal(); |
48 profile_manager_.reset(new TestingProfileManager(browser_process)); | 48 profile_manager_.reset(new TestingProfileManager(browser_process)); |
49 ASSERT_TRUE(profile_manager_->SetUp()); | 49 ASSERT_TRUE(profile_manager_->SetUp()); |
50 profile_info_cache_ = profile_manager_->profile_info_cache(); | 50 profile_info_cache_ = profile_manager_->profile_info_cache(); |
51 profile_shortcut_manager_.reset( | 51 profile_shortcut_manager_.reset( |
52 ProfileShortcutManager::Create(profile_manager_->profile_manager())); | 52 ProfileShortcutManager::Create(profile_manager_->profile_manager())); |
53 | 53 |
54 ASSERT_TRUE(PathService::Get(base::FILE_EXE, &exe_path_)); | 54 ASSERT_TRUE(PathService::Get(base::FILE_EXE, &exe_path_)); |
55 ASSERT_TRUE(ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_DESKTOP, | 55 ASSERT_TRUE(ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_DESKTOP, |
56 distribution_, | 56 distribution_, |
57 ShellUtil::CURRENT_USER, | 57 ShellUtil::CURRENT_USER, |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 CreateRegularShortcutWithName(FROM_HERE, L"MyChrome"); | 439 CreateRegularShortcutWithName(FROM_HERE, L"MyChrome"); |
440 | 440 |
441 // Add another profile and check that one shortcut was renamed and that the | 441 // Add another profile and check that one shortcut was renamed and that the |
442 // other shortcut was updated but kept the same name. | 442 // other shortcut was updated but kept the same name. |
443 CreateProfileWithShortcut(FROM_HERE, profile_2_name_, profile_2_path_); | 443 CreateProfileWithShortcut(FROM_HERE, profile_2_name_, profile_2_path_); |
444 EXPECT_FALSE(file_util::PathExists(regular_shortcut_path)); | 444 EXPECT_FALSE(file_util::PathExists(regular_shortcut_path)); |
445 ValidateProfileShortcutAtPath(FROM_HERE, customized_regular_shortcut_path, | 445 ValidateProfileShortcutAtPath(FROM_HERE, customized_regular_shortcut_path, |
446 profile_1_path_); | 446 profile_1_path_); |
447 ValidateProfileShortcut(FROM_HERE, profile_1_name_, profile_1_path_); | 447 ValidateProfileShortcut(FROM_HERE, profile_1_name_, profile_1_path_); |
448 } | 448 } |
OLD | NEW |