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

Unified Diff: chrome/browser/cocoa/bookmark_bar_state_controller_unittest.mm

Issue 46078: Mac bookmark work. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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/cocoa/bookmark_bar_state_controller.mm ('k') | chrome/browser/cocoa/bookmark_menu_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/bookmark_bar_state_controller_unittest.mm
===================================================================
--- chrome/browser/cocoa/bookmark_bar_state_controller_unittest.mm (revision 0)
+++ chrome/browser/cocoa/bookmark_bar_state_controller_unittest.mm (revision 0)
@@ -0,0 +1,45 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/browser.h"
+#include "chrome/browser/cocoa/bookmark_bar_state_controller.h"
+#include "chrome/browser/cocoa/browser_test_helper.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+@interface NoPrefSaveBBStateController : BookmarkBarStateController {
+ @public
+ BOOL toggled_;
+}
+@end
+
+@implementation NoPrefSaveBBStateController
+- (void)togglePreference {
+ toggled_ = !toggled_;
+}
+@end
+
+
+class BookmarkBarStateControllerTest : public testing::Test {
+ public:
+ BrowserTestHelper browser_test_helper_;
+};
+
+
+TEST_F(BookmarkBarStateControllerTest, MainTest) {
+ Browser* browser = browser_test_helper_.GetBrowser();
+ NoPrefSaveBBStateController *c = [[[NoPrefSaveBBStateController alloc]
+ initWithBrowser:browser]
+ autorelease];
+ EXPECT_TRUE(c);
+ EXPECT_FALSE(c->toggled_);
+ BOOL old_visible = [c visible];
+
+ [c toggleBookmarkBar];
+ EXPECT_TRUE(c->toggled_ != NO);
+ EXPECT_NE((bool)old_visible, (bool)[c visible]);
+
+ [c toggleBookmarkBar];
+ EXPECT_FALSE(c->toggled_);
+ EXPECT_EQ((bool)old_visible, (bool)[c visible]);
+}
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_state_controller.mm ('k') | chrome/browser/cocoa/bookmark_menu_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698