summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/browser_window_controller_unittest.mm
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 00:55:35 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 00:55:35 +0000
commitf9bc9b9ca68926b2687ae073941c8186aa3aed0d (patch)
treea15d6b735ca16d4739d1ce435512fe311bf8ef1a /chrome/browser/cocoa/browser_window_controller_unittest.mm
parent6b5cc7aeca6761c88c0f98b0e54990becbe32177 (diff)
downloadchromium_src-f9bc9b9ca68926b2687ae073941c8186aa3aed0d.zip
chromium_src-f9bc9b9ca68926b2687ae073941c8186aa3aed0d.tar.gz
chromium_src-f9bc9b9ca68926b2687ae073941c8186aa3aed0d.tar.bz2
Added main menu item for Sync in OS X. (Right below "Preferences..."). Made it work without a browser window being present.
Moved menu verification code into sync_status_ui_helper_mac{.h,.mm,_unittest.mm}. BUG=27995 TEST=tested that the main menu item worked with or without a browser window. tested that the main menu item didn't show up unless --enable-sync was passed in. Review URL: http://codereview.chromium.org/423004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32892 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller_unittest.mm')
-rw-r--r--chrome/browser/cocoa/browser_window_controller_unittest.mm71
1 files changed, 0 insertions, 71 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller_unittest.mm b/chrome/browser/cocoa/browser_window_controller_unittest.mm
index 81cccc9..857cbd9 100644
--- a/chrome/browser/cocoa/browser_window_controller_unittest.mm
+++ b/chrome/browser/cocoa/browser_window_controller_unittest.mm
@@ -492,77 +492,6 @@ TEST_F(BrowserWindowControllerTest, TestFindBarOnTop) {
EXPECT_GT(findBar_index, bookmark_index);
}
-TEST_F(BrowserWindowControllerTest, TestSyncMenuItem) {
- scoped_nsobject<NSMenuItem> syncMenuItem(
- [[NSMenuItem alloc] initWithTitle:@""
- action:@selector(commandDispatch)
- keyEquivalent:@""]);
- [syncMenuItem setTag:IDC_SYNC_BOOKMARKS];
-
- NSString* bookmarksSynced =
- l10n_util::GetNSStringWithFixup(IDS_SYNC_MENU_BOOKMARKS_SYNCED_LABEL);
- NSString* bookmarkSyncError =
- l10n_util::GetNSStringWithFixup(IDS_SYNC_MENU_BOOKMARK_SYNC_ERROR_LABEL);
- NSString* startSync =
- l10n_util::GetNSStringWithFixup(IDS_SYNC_START_SYNC_BUTTON_LABEL);
-
- [syncMenuItem setTitle:@""];
- [syncMenuItem setHidden:NO];
- [controller_ updateSyncItem:syncMenuItem
- syncEnabled:NO
- status:SyncStatusUIHelper::PRE_SYNCED];
- EXPECT_TRUE([[syncMenuItem title] isEqualTo:startSync]);
- EXPECT_TRUE([syncMenuItem isHidden]);
-
- [syncMenuItem setTitle:@""];
- [syncMenuItem setHidden:YES];
- [controller_ updateSyncItem:syncMenuItem
- syncEnabled:YES
- status:SyncStatusUIHelper::SYNC_ERROR];
- EXPECT_TRUE([[syncMenuItem title] isEqualTo:bookmarkSyncError]);
- EXPECT_FALSE([syncMenuItem isHidden]);
-
- [syncMenuItem setTitle:@""];
- [syncMenuItem setHidden:NO];
- [controller_ updateSyncItem:syncMenuItem
- syncEnabled:NO
- status:SyncStatusUIHelper::SYNCED];
- EXPECT_TRUE([[syncMenuItem title] isEqualTo:bookmarksSynced]);
- EXPECT_TRUE([syncMenuItem isHidden]);
-}
-
-TEST_F(BrowserWindowControllerTest, TestSyncMenuItemWithSeparator) {
- scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]);
- NSMenuItem* syncMenuItem =
- [menu addItemWithTitle:@""
- action:@selector(commandDispatch)
- keyEquivalent:@""];
- [syncMenuItem setTag:IDC_SYNC_BOOKMARKS];
- NSMenuItem* following_separator = [NSMenuItem separatorItem];
- [menu addItem:following_separator];
-
- const SyncStatusUIHelper::MessageType kStatus =
- SyncStatusUIHelper::PRE_SYNCED;
-
- [syncMenuItem setHidden:NO];
- [following_separator setHidden:NO];
- [controller_ updateSyncItem:syncMenuItem
- syncEnabled:NO
- status:kStatus];
- EXPECT_FALSE([following_separator isEnabled]);
- EXPECT_TRUE([syncMenuItem isHidden]);
- EXPECT_TRUE([following_separator isHidden]);
-
- [syncMenuItem setHidden:YES];
- [following_separator setHidden:YES];
- [controller_ updateSyncItem:syncMenuItem
- syncEnabled:YES
- status:kStatus];
- EXPECT_FALSE([following_separator isEnabled]);
- EXPECT_FALSE([syncMenuItem isHidden]);
- EXPECT_FALSE([following_separator isHidden]);
-}
-
@interface BrowserWindowControllerFakeFullscreen : BrowserWindowController {
@private
// We release the window ourselves, so we don't have to rely on the unittest