Chromium Code Reviews| 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/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 FilePath profile_1_path_; | 278 FilePath profile_1_path_; |
| 279 string16 profile_2_name_; | 279 string16 profile_2_name_; |
| 280 FilePath profile_2_path_; | 280 FilePath profile_2_path_; |
| 281 string16 profile_3_name_; | 281 string16 profile_3_name_; |
| 282 FilePath profile_3_path_; | 282 FilePath profile_3_path_; |
| 283 }; | 283 }; |
| 284 | 284 |
| 285 TEST_F(ProfileShortcutManagerTest, ShortcutFilename) { | 285 TEST_F(ProfileShortcutManagerTest, ShortcutFilename) { |
| 286 const string16 kProfileName = L"Harry"; | 286 const string16 kProfileName = L"Harry"; |
| 287 BrowserDistribution* distribution = GetDistribution(); | 287 BrowserDistribution* distribution = GetDistribution(); |
| 288 const string16 expected_name = kProfileName + L" - " + | 288 #if defined(GOOGLE_CHROME_BUILD) |
|
sail
2013/02/05 20:30:43
I don't think this is a good idea. You should use
Alexei Svitkine (slow)
2013/02/05 20:56:00
Done.
| |
| 289 distribution->GetAppShortCutName() + installer::kLnkExt; | 289 const string16 expected_name = L"Harry - Chrome"; |
| 290 EXPECT_EQ(expected_name, | 290 #else |
| 291 const string16 expected_name = L"Harry - Chromium"; | |
| 292 #endif | |
| 293 EXPECT_EQ(expected_name + installer::kLnkExt, | |
| 291 profiles::internal::GetShortcutFilenameForProfile(kProfileName, | 294 profiles::internal::GetShortcutFilenameForProfile(kProfileName, |
| 292 distribution)); | 295 distribution)); |
| 293 } | 296 } |
| 294 | 297 |
| 295 TEST_F(ProfileShortcutManagerTest, ShortcutLongFilenameIsTrimmed) { | 298 TEST_F(ProfileShortcutManagerTest, ShortcutLongFilenameIsTrimmed) { |
| 296 const string16 kLongProfileName = L"Harry Harry Harry Harry Harry Harry Harry" | 299 const string16 kLongProfileName = L"Harry Harry Harry Harry Harry Harry Harry" |
| 297 L"Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry" | 300 L"Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry" |
| 298 L"Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry"; | 301 L"Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry"; |
| 299 const string16 file_name = | 302 const string16 file_name = |
| 300 profiles::internal::GetShortcutFilenameForProfile(kLongProfileName, | 303 profiles::internal::GetShortcutFilenameForProfile(kLongProfileName, |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 732 profile_info_cache_->DeleteProfileFromCache(profile_2_path_); | 735 profile_info_cache_->DeleteProfileFromCache(profile_2_path_); |
| 733 RunPendingTasks(); | 736 RunPendingTasks(); |
| 734 | 737 |
| 735 // Verify that only the system-level shortcut still exists. | 738 // Verify that only the system-level shortcut still exists. |
| 736 EXPECT_TRUE(file_util::PathExists(system_level_shortcut_path)); | 739 EXPECT_TRUE(file_util::PathExists(system_level_shortcut_path)); |
| 737 EXPECT_FALSE(file_util::PathExists( | 740 EXPECT_FALSE(file_util::PathExists( |
| 738 GetDefaultShortcutPathForProfile(string16()))); | 741 GetDefaultShortcutPathForProfile(string16()))); |
| 739 EXPECT_FALSE(file_util::PathExists(profile_1_shortcut_path)); | 742 EXPECT_FALSE(file_util::PathExists(profile_1_shortcut_path)); |
| 740 EXPECT_FALSE(file_util::PathExists(profile_2_shortcut_path)); | 743 EXPECT_FALSE(file_util::PathExists(profile_2_shortcut_path)); |
| 741 } | 744 } |
| OLD | NEW |