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 #import "chrome/browser/web_applications/web_app_mac.h" | 5 #import "chrome/browser/web_applications/web_app_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <sys/xattr.h> | 10 #include <sys/xattr.h> |
(...skipping 26 matching lines...) Expand all Loading... |
37 using ::testing::NiceMock; | 37 using ::testing::NiceMock; |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 const char kFakeChromeBundleId[] = "fake.cfbundleidentifier"; | 41 const char kFakeChromeBundleId[] = "fake.cfbundleidentifier"; |
42 | 42 |
43 class WebAppShortcutCreatorMock : public web_app::WebAppShortcutCreator { | 43 class WebAppShortcutCreatorMock : public web_app::WebAppShortcutCreator { |
44 public: | 44 public: |
45 WebAppShortcutCreatorMock(const base::FilePath& app_data_dir, | 45 WebAppShortcutCreatorMock(const base::FilePath& app_data_dir, |
46 const web_app::ShortcutInfo* shortcut_info) | 46 const web_app::ShortcutInfo* shortcut_info) |
47 : WebAppShortcutCreator(app_data_dir, | 47 : WebAppShortcutCreator(app_data_dir, shortcut_info) {} |
48 shortcut_info, | |
49 extensions::FileHandlersInfo()) {} | |
50 | |
51 WebAppShortcutCreatorMock( | |
52 const base::FilePath& app_data_dir, | |
53 const web_app::ShortcutInfo* shortcut_info, | |
54 const extensions::FileHandlersInfo& file_handlers_info) | |
55 : WebAppShortcutCreator(app_data_dir, shortcut_info, file_handlers_info) { | |
56 } | |
57 | 48 |
58 MOCK_CONST_METHOD0(GetApplicationsDirname, base::FilePath()); | 49 MOCK_CONST_METHOD0(GetApplicationsDirname, base::FilePath()); |
59 MOCK_CONST_METHOD1(GetAppBundleById, | 50 MOCK_CONST_METHOD1(GetAppBundleById, |
60 base::FilePath(const std::string& bundle_id)); | 51 base::FilePath(const std::string& bundle_id)); |
61 MOCK_CONST_METHOD0(RevealAppShimInFinder, void()); | 52 MOCK_CONST_METHOD0(RevealAppShimInFinder, void()); |
62 | 53 |
63 private: | 54 private: |
64 DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreatorMock); | 55 DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreatorMock); |
65 }; | 56 }; |
66 | 57 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 .Times(0); | 329 .Times(0); |
339 EXPECT_TRUE(shortcut_creator.CreateShortcuts( | 330 EXPECT_TRUE(shortcut_creator.CreateShortcuts( |
340 SHORTCUT_CREATION_AUTOMATED, web_app::ShortcutLocations())); | 331 SHORTCUT_CREATION_AUTOMATED, web_app::ShortcutLocations())); |
341 | 332 |
342 EXPECT_CALL(shortcut_creator, RevealAppShimInFinder()); | 333 EXPECT_CALL(shortcut_creator, RevealAppShimInFinder()); |
343 EXPECT_TRUE(shortcut_creator.CreateShortcuts( | 334 EXPECT_TRUE(shortcut_creator.CreateShortcuts( |
344 SHORTCUT_CREATION_BY_USER, web_app::ShortcutLocations())); | 335 SHORTCUT_CREATION_BY_USER, web_app::ShortcutLocations())); |
345 } | 336 } |
346 | 337 |
347 } // namespace web_app | 338 } // namespace web_app |
OLD | NEW |