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 <map> | 7 #include <map> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 web_app::GenerateApplicationNameFromURL(GURL(test_cases[i].url)), | 358 web_app::GenerateApplicationNameFromURL(GURL(test_cases[i].url)), |
359 GURL(test_cases[i].url), | 359 GURL(test_cases[i].url), |
360 "", | 360 "", |
361 false, | 361 false, |
362 FilePath(), | 362 FilePath(), |
363 ASCIIToUTF16(test_cases[i].title), | 363 ASCIIToUTF16(test_cases[i].title), |
364 test_cases[i].icon_name)); | 364 test_cases[i].icon_name)); |
365 } | 365 } |
366 } | 366 } |
367 #elif defined(OS_WIN) | 367 #elif defined(OS_WIN) |
368 TEST(ShellIntegrationTest, GetChromiumAppIdTest) { | 368 TEST(ShellIntegrationTest, GetAppModelIdTest) { |
| 369 const string16 base_app_id( |
| 370 BrowserDistribution::GetDistribution()->GetBaseAppId()); |
| 371 |
369 // Empty profile path should get chrome::kBrowserAppID | 372 // Empty profile path should get chrome::kBrowserAppID |
370 FilePath empty_path; | 373 FilePath empty_path; |
371 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId(), | 374 EXPECT_EQ(base_app_id, |
372 ShellIntegration::GetChromiumAppId(empty_path)); | 375 ShellIntegration::GetAppModelId(base_app_id, empty_path)); |
373 | 376 |
374 // Default profile path should get chrome::kBrowserAppID | 377 // Default profile path should get chrome::kBrowserAppID |
375 FilePath default_user_data_dir; | 378 FilePath default_user_data_dir; |
376 chrome::GetDefaultUserDataDirectory(&default_user_data_dir); | 379 chrome::GetDefaultUserDataDirectory(&default_user_data_dir); |
377 FilePath default_profile_path = | 380 FilePath default_profile_path = |
378 default_user_data_dir.AppendASCII(chrome::kInitialProfile); | 381 default_user_data_dir.AppendASCII(chrome::kInitialProfile); |
379 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId(), | 382 EXPECT_EQ(base_app_id, |
380 ShellIntegration::GetChromiumAppId(default_profile_path)); | 383 ShellIntegration::GetAppModelId(base_app_id, default_profile_path)); |
381 | 384 |
382 // Non-default profile path should get chrome::kBrowserAppID joined with | 385 // Non-default profile path should get chrome::kBrowserAppID joined with |
383 // profile info. | 386 // profile info. |
384 FilePath profile_path(FILE_PATH_LITERAL("root")); | 387 FilePath profile_path(FILE_PATH_LITERAL("root")); |
385 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); | 388 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); |
386 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); | 389 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); |
387 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId() + | 390 EXPECT_EQ(base_app_id + L".udd.UserDataTest", |
388 L".udd.UserDataTest", | 391 ShellIntegration::GetAppModelId(base_app_id, profile_path)); |
389 ShellIntegration::GetChromiumAppId(profile_path)); | |
390 } | 392 } |
391 #endif | 393 #endif |
OLD | NEW |