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

Unified Diff: chrome/browser/web_applications/web_app_mac_unittest.mm

Issue 9426030: Mac: Enable WebAppShortcutCreatorTest.CreateShortcut unit test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch for landing Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/web_applications/web_app_mac.mm ('k') | chrome/common/mac/app_mode_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_applications/web_app_mac_unittest.mm
diff --git a/chrome/browser/web_applications/web_app_mac_unittest.mm b/chrome/browser/web_applications/web_app_mac_unittest.mm
index fa11eaaef7ac796fa79de256913d820e39bf8819..a2b78dceac00fab1fee1c6c46a33a1fd1a1a0f79 100644
--- a/chrome/browser/web_applications/web_app_mac_unittest.mm
+++ b/chrome/browser/web_applications/web_app_mac_unittest.mm
@@ -30,16 +30,18 @@ class WebAppShortcutCreatorMock : public web_app::WebAppShortcutCreator {
public:
explicit WebAppShortcutCreatorMock(
const ShellIntegration::ShortcutInfo& shortcut_info)
- : WebAppShortcutCreator(FilePath(), shortcut_info,
+ : WebAppShortcutCreator(FilePath("/fake/path"), shortcut_info,
UTF8ToUTF16("fake.cfbundleidentifier")) {
}
MOCK_CONST_METHOD1(GetDestinationPath, FilePath(const FilePath&));
+ MOCK_CONST_METHOD1(RevealGeneratedBundleInFinder, void(const FilePath&));
};
ShellIntegration::ShortcutInfo GetShortcutInfo() {
ShellIntegration::ShortcutInfo info;
info.extension_id = "extension_id";
+ info.extension_path = FilePath("/fake/extension/path");
info.title = ASCIIToUTF16("Shortcut Title");
info.url = GURL("http://example.com/");
return info;
@@ -53,7 +55,7 @@ namespace web_app {
// * The plist still isn't filled in correctly.
// * WebAppShortcutCreator::CreateShortcut() opens a Finder window which it
// shouldn't be doing when run from a unit test.
-TEST(WebAppShortcutCreatorTest, DISABLED_CreateShortcut) {
+TEST(WebAppShortcutCreatorTest, CreateShortcut) {
ScopedTempDir scoped_temp_dir;
EXPECT_TRUE(scoped_temp_dir.CreateUniqueTempDir());
FilePath dst_path = scoped_temp_dir.path().Append("a.app");
@@ -62,6 +64,8 @@ TEST(WebAppShortcutCreatorTest, DISABLED_CreateShortcut) {
NiceMock<WebAppShortcutCreatorMock> shortcut_creator(info);
EXPECT_CALL(shortcut_creator, GetDestinationPath(_))
.WillRepeatedly(Return(dst_path));
+ EXPECT_CALL(shortcut_creator, RevealGeneratedBundleInFinder(dst_path));
+
EXPECT_TRUE(shortcut_creator.CreateShortcut());
EXPECT_TRUE(file_util::PathExists(dst_path));
@@ -86,7 +90,7 @@ TEST(WebAppShortcutCreatorTest, DISABLED_CreateShortcut) {
}
}
-TEST(WebAppShortcutCreatorTest, DISABLED_CreateFailure) {
+TEST(WebAppShortcutCreatorTest, CreateFailure) {
NiceMock<WebAppShortcutCreatorMock> shortcut_creator(GetShortcutInfo());
EXPECT_CALL(shortcut_creator, GetDestinationPath(_))
.WillRepeatedly(Return(FilePath("/non-existant/path/")));
« no previous file with comments | « chrome/browser/web_applications/web_app_mac.mm ('k') | chrome/common/mac/app_mode_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698