Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: chrome/browser/shell_integration_unittest.cc

Issue 9958006: Create Linux platform app shortcuts to run in their own process. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Create updated shortcuts from NTP, add enable flag Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 }; 350 };
351 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); i++) { 351 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); i++) {
352 SCOPED_TRACE(i); 352 SCOPED_TRACE(i);
353 EXPECT_EQ( 353 EXPECT_EQ(
354 test_cases[i].expected_output, 354 test_cases[i].expected_output,
355 ShellIntegration::GetDesktopFileContents( 355 ShellIntegration::GetDesktopFileContents(
356 test_cases[i].template_contents, 356 test_cases[i].template_contents,
357 web_app::GenerateApplicationNameFromURL(GURL(test_cases[i].url)), 357 web_app::GenerateApplicationNameFromURL(GURL(test_cases[i].url)),
358 GURL(test_cases[i].url), 358 GURL(test_cases[i].url),
359 "", 359 "",
360 false,
361 FilePath(),
362 FilePath(),
360 ASCIIToUTF16(test_cases[i].title), 363 ASCIIToUTF16(test_cases[i].title),
361 test_cases[i].icon_name)); 364 test_cases[i].icon_name));
362 } 365 }
363 } 366 }
364 #elif defined(OS_WIN) 367 #elif defined(OS_WIN)
365 TEST(ShellIntegrationTest, GetChromiumAppIdTest) { 368 TEST(ShellIntegrationTest, GetChromiumAppIdTest) {
366 // Empty profile path should get chrome::kBrowserAppID 369 // Empty profile path should get chrome::kBrowserAppID
367 FilePath empty_path; 370 FilePath empty_path;
368 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId(), 371 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId(),
369 ShellIntegration::GetChromiumAppId(empty_path)); 372 ShellIntegration::GetChromiumAppId(empty_path));
370 373
371 // Default profile path should get chrome::kBrowserAppID 374 // Default profile path should get chrome::kBrowserAppID
372 FilePath default_user_data_dir; 375 FilePath default_user_data_dir;
373 chrome::GetDefaultUserDataDirectory(&default_user_data_dir); 376 chrome::GetDefaultUserDataDirectory(&default_user_data_dir);
374 FilePath default_profile_path = 377 FilePath default_profile_path =
375 default_user_data_dir.AppendASCII(chrome::kInitialProfile); 378 default_user_data_dir.AppendASCII(chrome::kInitialProfile);
376 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId(), 379 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId(),
377 ShellIntegration::GetChromiumAppId(default_profile_path)); 380 ShellIntegration::GetChromiumAppId(default_profile_path));
378 381
379 // Non-default profile path should get chrome::kBrowserAppID joined with 382 // Non-default profile path should get chrome::kBrowserAppID joined with
380 // profile info. 383 // profile info.
381 FilePath profile_path(FILE_PATH_LITERAL("root")); 384 FilePath profile_path(FILE_PATH_LITERAL("root"));
382 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); 385 profile_path = profile_path.Append(FILE_PATH_LITERAL("udd"));
383 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); 386 profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test"));
384 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId() + 387 EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId() +
385 L".udd.UserDataTest", 388 L".udd.UserDataTest",
386 ShellIntegration::GetChromiumAppId(profile_path)); 389 ShellIntegration::GetChromiumAppId(profile_path));
387 } 390 }
388 #endif 391 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698