| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 }; | 152 }; |
| 153 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); i++) { | 153 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); i++) { |
| 154 EXPECT_EQ(std::string(chrome::kBrowserProcessExecutableName) + "-" + | 154 EXPECT_EQ(std::string(chrome::kBrowserProcessExecutableName) + "-" + |
| 155 test_cases[i].path, | 155 test_cases[i].path, |
| 156 ShellIntegration::GetDesktopShortcutFilename( | 156 ShellIntegration::GetDesktopShortcutFilename( |
| 157 GURL(test_cases[i].url)).value()) << | 157 GURL(test_cases[i].url)).value()) << |
| 158 " while testing " << test_cases[i].url; | 158 " while testing " << test_cases[i].url; |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 TEST(ShellIntegrationTest, GetDesktopFileContents) { | 162 // Fails on Linux Aura, see http://crbug.com/100346 |
| 163 #if defined(USE_AURA) && !defined(OS_WIN) |
| 164 #define MAYBE_GetDesktopFileContents FAILS_GetDesktopFileContents |
| 165 #else |
| 166 #define MAYBE_GetDesktopFileContents GetDesktopFileContents |
| 167 #endif |
| 168 TEST(ShellIntegrationTest, MAYBE_GetDesktopFileContents) { |
| 163 const struct { | 169 const struct { |
| 164 const char* url; | 170 const char* url; |
| 165 const char* title; | 171 const char* title; |
| 166 const char* icon_name; | 172 const char* icon_name; |
| 167 const char* template_contents; | 173 const char* template_contents; |
| 168 const char* expected_output; | 174 const char* expected_output; |
| 169 } test_cases[] = { | 175 } test_cases[] = { |
| 170 // Dumb case. | 176 // Dumb case. |
| 171 { "ignored", "ignored", "ignored", "", "#!/usr/bin/env xdg-open\n" }, | 177 { "ignored", "ignored", "ignored", "", "#!/usr/bin/env xdg-open\n" }, |
| 172 | 178 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 // Non-default profile path should get chrome::kBrowserAppID joined with | 355 // Non-default profile path should get chrome::kBrowserAppID joined with |
| 350 // profile info. | 356 // profile info. |
| 351 FilePath profile_path(FILE_PATH_LITERAL("root")); | 357 FilePath profile_path(FILE_PATH_LITERAL("root")); |
| 352 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); | 358 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); |
| 353 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); | 359 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); |
| 354 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId() + | 360 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId() + |
| 355 L".udd.UserDataTest", | 361 L".udd.UserDataTest", |
| 356 ShellIntegration::GetChromiumAppId(profile_path)); | 362 ShellIntegration::GetChromiumAppId(profile_path)); |
| 357 } | 363 } |
| 358 #endif | 364 #endif |
| OLD | NEW |