| 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/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // appid instead of being totally different. | 134 // appid instead of being totally different. |
| 135 base::string16 chrome_app_id_is_prefix(chrome_app_id_); | 135 base::string16 chrome_app_id_is_prefix(chrome_app_id_); |
| 136 chrome_app_id_is_prefix.push_back(L'1'); | 136 chrome_app_id_is_prefix.push_back(L'1'); |
| 137 temp_properties.set_target(chrome_exe_); | 137 temp_properties.set_target(chrome_exe_); |
| 138 temp_properties.set_app_id(chrome_app_id_is_prefix); | 138 temp_properties.set_app_id(chrome_app_id_is_prefix); |
| 139 ASSERT_NO_FATAL_FAILURE( | 139 ASSERT_NO_FATAL_FAILURE( |
| 140 AddTestShortcutAndResetProperties(&temp_properties)); | 140 AddTestShortcutAndResetProperties(&temp_properties)); |
| 141 | 141 |
| 142 // Shortcut 4 is like shortcut 1, but it's appid is of the same size as the | 142 // Shortcut 4 is like shortcut 1, but it's appid is of the same size as the |
| 143 // expected appid. | 143 // expected appid. |
| 144 base::string16 same_size_as_chrome_app_id(L'1', chrome_app_id_.size()); | 144 base::string16 same_size_as_chrome_app_id(chrome_app_id_.size(), L'1'); |
| 145 temp_properties.set_target(chrome_exe_); | 145 temp_properties.set_target(chrome_exe_); |
| 146 temp_properties.set_app_id(same_size_as_chrome_app_id); | 146 temp_properties.set_app_id(same_size_as_chrome_app_id); |
| 147 ASSERT_NO_FATAL_FAILURE( | 147 ASSERT_NO_FATAL_FAILURE( |
| 148 AddTestShortcutAndResetProperties(&temp_properties)); | 148 AddTestShortcutAndResetProperties(&temp_properties)); |
| 149 | 149 |
| 150 // Shortcut 5 doesn't have an app_id, nor is dual_mode even set; they should | 150 // Shortcut 5 doesn't have an app_id, nor is dual_mode even set; they should |
| 151 // be set as expected upon migration. | 151 // be set as expected upon migration. |
| 152 temp_properties.set_target(chrome_exe_); | 152 temp_properties.set_target(chrome_exe_); |
| 153 ASSERT_NO_FATAL_FAILURE( | 153 ASSERT_NO_FATAL_FAILURE( |
| 154 AddTestShortcutAndResetProperties(&temp_properties)); | 154 AddTestShortcutAndResetProperties(&temp_properties)); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 default_profile_path)); | 420 default_profile_path)); |
| 421 | 421 |
| 422 // Non-default profile path should get chrome::kBrowserAppID + AppList joined | 422 // Non-default profile path should get chrome::kBrowserAppID + AppList joined |
| 423 // with profile info. | 423 // with profile info. |
| 424 base::FilePath profile_path(FILE_PATH_LITERAL("root")); | 424 base::FilePath profile_path(FILE_PATH_LITERAL("root")); |
| 425 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); | 425 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); |
| 426 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); | 426 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); |
| 427 EXPECT_EQ(base_app_id + L".udd.UserDataTest", | 427 EXPECT_EQ(base_app_id + L".udd.UserDataTest", |
| 428 ShellIntegration::GetAppListAppModelIdForProfile(profile_path)); | 428 ShellIntegration::GetAppListAppModelIdForProfile(profile_path)); |
| 429 } | 429 } |
| OLD | NEW |