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

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

Issue 9416012: Mac: Generate App Mode Loader bundle + cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix review comments 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
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 0f43fb1e339bd621cfa622d4469544b4a6047e24..3fd37df4d7431fb77797f465a36f3ccc995de255 100644
--- a/chrome/browser/web_applications/web_app_mac_unittest.mm
+++ b/chrome/browser/web_applications/web_app_mac_unittest.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/web_applications/web_app_mac.h"
+#import "chrome/browser/web_applications/web_app_mac.h"
#include "base/file_util.h"
#include "base/mac/foundation_util.h"
@@ -24,7 +24,8 @@ class WebAppShortcutCreatorMock : public web_app::WebAppShortcutCreator {
public:
explicit WebAppShortcutCreatorMock(
const ShellIntegration::ShortcutInfo& shortcut_info)
- : WebAppShortcutCreator(shortcut_info) {
+ : WebAppShortcutCreator(shortcut_info,
+ UTF8ToUTF16("fake.cfbundleidentifier")) {
}
MOCK_CONST_METHOD1(GetDestinationPath, FilePath(const FilePath&));
@@ -38,8 +39,11 @@ ShellIntegration::ShortcutInfo GetShortcutInfo() {
return info;
}
-// This test currently fails because the Mac app loader isn't built yet.
-TEST(WebAppShortcutCreatorTest, FAILS_CreateShortcut) {
+// This test is disabled for the following reasons:
+// * 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) {
ScopedTempDir scoped_temp_dir;
EXPECT_TRUE(scoped_temp_dir.CreateUniqueTempDir());
FilePath dst_path = scoped_temp_dir.path().Append("a.app");
@@ -62,8 +66,14 @@ TEST(WebAppShortcutCreatorTest, FAILS_CreateShortcut) {
[plist objectForKey:app_mode::kCrAppModeShortcutURLKey]);
// Make sure all values in the plist are actually filled in.
- for (NSString* value in [plist allValues])
- EXPECT_FALSE([value hasPrefix:@"@APP_"]);
+ for (id key in plist) {
+ id value = [plist valueForKey:key];
+ if (!base::mac::ObjCCast<NSString>(value))
+ continue;
+
+ EXPECT_EQ([value rangeOfString:@"@APP_"].location, NSNotFound)
+ << [key UTF8String] << ":" << [value UTF8String];
+ }
}
TEST(WebAppShortcutCreatorTest, CreateFailure) {

Powered by Google App Engine
This is Rietveld 408576698