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

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: 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..5be40206c269b3bed1ec3e3793ae1a5c4d52da9d 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"
@@ -38,8 +38,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) {
jeremy 2012/02/16 12:55:34 Sorry I'm not fixing the test as part of this CL b
ScopedTempDir scoped_temp_dir;
EXPECT_TRUE(scoped_temp_dir.CreateUniqueTempDir());
FilePath dst_path = scoped_temp_dir.path().Append("a.app");
@@ -48,7 +51,7 @@ TEST(WebAppShortcutCreatorTest, FAILS_CreateShortcut) {
NiceMock<WebAppShortcutCreatorMock> shortcut_creator(info);
EXPECT_CALL(shortcut_creator, GetDestinationPath(_))
.WillRepeatedly(Return(dst_path));
- EXPECT_TRUE(shortcut_creator.CreateShortcut());
+ EXPECT_TRUE(shortcut_creator.CreateShortcut(@"fake.cfbundleidentifier"));
EXPECT_TRUE(file_util::PathExists(dst_path));
FilePath plist_path = dst_path.Append("Contents").Append("Info.plist");
@@ -62,15 +65,21 @@ 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 (![value isKindOfClass:[NSString class]])
+ continue;
+
+ EXPECT_EQ([value rangeOfString:@"@APP_"].location, NSNotFound)
+ << [key UTF8String] << ":" << [value UTF8String];
+ }
}
-TEST(WebAppShortcutCreatorTest, CreateFailure) {
+TEST(WebAppShortcutCreatorTest, DISABLED_CreateFailure) {
sail 2012/02/17 16:42:09 Is this failing now? If so can you put a comment a
jeremy 2012/02/19 14:36:41 You're right, reverted.
NiceMock<WebAppShortcutCreatorMock> shortcut_creator(GetShortcutInfo());
EXPECT_CALL(shortcut_creator, GetDestinationPath(_))
.WillRepeatedly(Return(FilePath("/non-existant/path/")));
- EXPECT_FALSE(shortcut_creator.CreateShortcut());
+ EXPECT_FALSE(shortcut_creator.CreateShortcut(@"fake.cfbundleidentifier"));
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698