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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm

Issue 73613002: InstantExtended: remove old flags, add new flag for query extraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 ++i) { 1545 ++i) {
1546 NSRect frame = [[bar_ view] frame]; 1546 NSRect frame = [[bar_ view] frame];
1547 frame.size.width = viewWidths[i] + bookmarks::kBookmarkRightMargin; 1547 frame.size.width = viewWidths[i] + bookmarks::kBookmarkRightMargin;
1548 [[bar_ view] setFrame:frame]; 1548 [[bar_ view] setFrame:frame];
1549 EXPECT_EQ(offTheSideButtonIsHiddenResults[i], 1549 EXPECT_EQ(offTheSideButtonIsHiddenResults[i],
1550 [bar_ offTheSideButtonIsHidden]); 1550 [bar_ offTheSideButtonIsHidden]);
1551 EXPECT_EQ(displayedButtonCountResults[i], [bar_ displayedButtonCount]); 1551 EXPECT_EQ(displayedButtonCountResults[i], [bar_ displayedButtonCount]);
1552 } 1552 }
1553 } 1553 }
1554 1554
1555 class BookmarkBarControllerWithInstantExtendedTest : 1555 TEST_F(BookmarkBarControllerTest, BookmarksWithAppsPageShortcut) {
1556 public BookmarkBarControllerTest {
1557 public:
1558 virtual void AddCommandLineSwitches() OVERRIDE {
1559 CommandLine::ForCurrentProcess()->AppendSwitch(
1560 switches::kEnableInstantExtendedAPI);
1561 }
1562 };
1563
1564 TEST_F(BookmarkBarControllerWithInstantExtendedTest,
1565 BookmarksWithAppsPageShortcut) {
1566 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile()); 1556 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
1567 const BookmarkNode* root = model->bookmark_bar_node(); 1557 const BookmarkNode* root = model->bookmark_bar_node();
1568 const std::string model_string("1b 2f:[ 2f1b 2f2b ] 3b "); 1558 const std::string model_string("1b 2f:[ 2f1b 2f2b ] 3b ");
1569 test::AddNodesFromModelString(model, root, model_string); 1559 test::AddNodesFromModelString(model, root, model_string);
1570 [bar_ frameDidChange]; 1560 [bar_ frameDidChange];
1571 1561
1572 // Apps page shortcut button should be visible. 1562 // Apps page shortcut button should be visible.
1573 ASSERT_FALSE([bar_ appsPageShortcutButtonIsHidden]); 1563 ASSERT_FALSE([bar_ appsPageShortcutButtonIsHidden]);
1574 1564
1575 // Bookmarks should be to the right of the Apps page shortcut button. 1565 // Bookmarks should be to the right of the Apps page shortcut button.
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
2079 "2f3b ] 4b "); 2069 "2f3b ] 4b ");
2080 actual = test::ModelStringFromNode(root); 2070 actual = test::ModelStringFromNode(root);
2081 EXPECT_EQ(expected, actual); 2071 EXPECT_EQ(expected, actual);
2082 2072
2083 // Verify that the other bookmark folder can't be deleted. 2073 // Verify that the other bookmark folder can't be deleted.
2084 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; 2074 BookmarkButton *otherButton = [bar_ otherBookmarksButton];
2085 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); 2075 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]);
2086 } 2076 }
2087 2077
2088 } // namespace 2078 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698