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 "chrome/browser/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 328 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); | 328 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); |
| 329 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); | 329 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); |
| 330 EXPECT_EQ(base_app_id + L".udd.UserDataTest", | 330 EXPECT_EQ(base_app_id + L".udd.UserDataTest", |
| 331 ShellIntegration::GetAppModelIdForProfile(base_app_id, | 331 ShellIntegration::GetAppModelIdForProfile(base_app_id, |
| 332 profile_path)); | 332 profile_path)); |
| 333 } | 333 } |
| 334 | 334 |
| 335 TEST(ShellIntegrationWinTest, GetAppListAppModelIdForProfileTest) { | 335 TEST(ShellIntegrationWinTest, GetAppListAppModelIdForProfileTest) { |
| 336 string16 base_app_id(BrowserDistribution::GetDistribution()->GetBaseAppId()); | 336 string16 base_app_id(BrowserDistribution::GetDistribution()->GetBaseAppId()); |
| 337 base_app_id.append(L"AppList"); | 337 base_app_id.append(L"AppList"); |
| 338 string16 suffix; | |
| 339 ShellUtil::GetUserSpecificRegistrySuffix(&suffix); | |
| 340 base_app_id.append(suffix); | |
|
gab
2013/04/29 21:34:44
You can remove this code.
calamity
2013/04/30 08:11:28
Done.
| |
| 338 | 341 |
| 339 // Empty profile path should get chrome::kBrowserAppID + AppList | 342 // Empty profile path should get chrome::kBrowserAppID + AppList |
| 340 base::FilePath empty_path; | 343 base::FilePath empty_path; |
| 341 EXPECT_EQ(base_app_id, | 344 EXPECT_EQ(base_app_id, |
| 342 ShellIntegration::GetAppListAppModelIdForProfile(empty_path)); | 345 ShellIntegration::GetAppListAppModelIdForProfile(empty_path)); |
| 343 | 346 |
| 344 // Default profile path should get chrome::kBrowserAppID + AppList | 347 // Default profile path should get chrome::kBrowserAppID + AppList |
| 345 base::FilePath default_user_data_dir; | 348 base::FilePath default_user_data_dir; |
| 346 chrome::GetDefaultUserDataDirectory(&default_user_data_dir); | 349 chrome::GetDefaultUserDataDirectory(&default_user_data_dir); |
| 347 base::FilePath default_profile_path = | 350 base::FilePath default_profile_path = |
| 348 default_user_data_dir.AppendASCII(chrome::kInitialProfile); | 351 default_user_data_dir.AppendASCII(chrome::kInitialProfile); |
| 349 EXPECT_EQ(base_app_id, | 352 EXPECT_EQ(base_app_id, |
| 350 ShellIntegration::GetAppListAppModelIdForProfile( | 353 ShellIntegration::GetAppListAppModelIdForProfile( |
| 351 default_profile_path)); | 354 default_profile_path)); |
| 352 | 355 |
| 353 // Non-default profile path should get chrome::kBrowserAppID + AppList joined | 356 // Non-default profile path should get chrome::kBrowserAppID + AppList joined |
| 354 // with profile info. | 357 // with profile info. |
| 355 base::FilePath profile_path(FILE_PATH_LITERAL("root")); | 358 base::FilePath profile_path(FILE_PATH_LITERAL("root")); |
| 356 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); | 359 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); |
| 357 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); | 360 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); |
| 358 EXPECT_EQ(base_app_id + L".udd.UserDataTest", | 361 EXPECT_EQ(base_app_id + L".udd.UserDataTest", |
| 359 ShellIntegration::GetAppListAppModelIdForProfile(profile_path)); | 362 ShellIntegration::GetAppListAppModelIdForProfile(profile_path)); |
| 360 } | 363 } |
| OLD | NEW |