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

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

Issue 14383003: Application shortcuts in Linux are now installed into a "Chrome Apps" folder. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: GetDirectoryFileContents needs the same \n hack as GetDesktopFileContents. Created 7 years, 7 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) 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 <cstdlib> 7 #include <cstdlib>
8 #include <map> 8 #include <map>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 GURL(test_cases[i].url), 464 GURL(test_cases[i].url),
465 std::string(), 465 std::string(),
466 base::FilePath(), 466 base::FilePath(),
467 ASCIIToUTF16(test_cases[i].title), 467 ASCIIToUTF16(test_cases[i].title),
468 test_cases[i].icon_name, 468 test_cases[i].icon_name,
469 base::FilePath(), 469 base::FilePath(),
470 test_cases[i].nodisplay)); 470 test_cases[i].nodisplay));
471 } 471 }
472 } 472 }
473 473
474 TEST(ShellIntegrationTest, GetDirectoryFileContents) {
475 const struct {
476 const char* title;
477 const char* icon_name;
478 const char* expected_output;
479 } test_cases[] = {
480 // Real-world case.
481 { "Chrome Apps",
482 "chrome-apps",
483
484 "[Desktop Entry]\n"
485 "Version=1.0\n"
486 "Type=Directory\n"
487 "Name=Chrome Apps\n"
488 "Icon=chrome-apps\n"
489 },
490
491 // Make sure that empty icons are replaced by the chrome icon.
492 { "Chrome Apps",
493 "",
494
495 "[Desktop Entry]\n"
496 "Version=1.0\n"
497 "Type=Directory\n"
498 "Name=Chrome Apps\n"
499 "Icon=chromium-browser\n"
500 },
501 };
502
503 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); i++) {
504 SCOPED_TRACE(i);
505 EXPECT_EQ(
506 test_cases[i].expected_output,
507 ShellIntegrationLinux::GetDirectoryFileContents(
508 ASCIIToUTF16(test_cases[i].title),
509 test_cases[i].icon_name));
510 }
511 }
512
474 #endif 513 #endif
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_linux.cc ('k') | chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698