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

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

Issue 2805099: Pulse new bookmarks (as triggered by bookmark bubble). If not possible, ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "app/theme_provider.h" 7 #include "app/theme_provider.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/scoped_nsobject.h" 9 #include "base/scoped_nsobject.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 expected = [targetButton left].x - baseOffset + xDelta; 2019 expected = [targetButton left].x - baseOffset + xDelta;
2020 EXPECT_CGFLOAT_EQ(expected, actual); 2020 EXPECT_CGFLOAT_EQ(expected, actual);
2021 targetButton = [bar_ buttonWithTitleEqualTo:@"4b"]; 2021 targetButton = [bar_ buttonWithTitleEqualTo:@"4b"];
2022 targetPoint = [targetButton right]; 2022 targetPoint = [targetButton right];
2023 targetPoint.x += 100; // Somewhere off to the right. 2023 targetPoint.x += 100; // Somewhere off to the right.
2024 expected = NSMaxX([targetButton frame]) + xDelta; 2024 expected = NSMaxX([targetButton frame]) + xDelta;
2025 actual = [bar_ indicatorPosForDragToPoint:targetPoint]; 2025 actual = [bar_ indicatorPosForDragToPoint:targetPoint];
2026 EXPECT_CGFLOAT_EQ(expected, actual); 2026 EXPECT_CGFLOAT_EQ(expected, actual);
2027 } 2027 }
2028 2028
2029 TEST_F(BookmarkBarControllerDragDropTest, PulseButton) {
2030 BookmarkModel* model = helper_.profile()->GetBookmarkModel();
2031 const BookmarkNode* root = model->GetBookmarkBarNode();
2032 GURL gurl("http://www.google.com");
2033 const BookmarkNode* node = model->AddURL(root, root->GetChildCount(),
2034 L"title", gurl);
2035
2036 BookmarkButton* button = [[bar_ buttons] objectAtIndex:0];
2037 EXPECT_FALSE([button isContinuousPulsing]);
2038
2039 NSValue *value = [NSValue valueWithPointer:node];
2040 NSDictionary *dict = [NSDictionary
2041 dictionaryWithObjectsAndKeys:value,
2042 bookmark_button::kBookmarkKey,
2043 [NSNumber numberWithBool:YES],
2044 bookmark_button::kBookmarkPulseFlagKey,
2045 nil];
2046 [[NSNotificationCenter defaultCenter]
2047 postNotificationName:bookmark_button::kPulseBookmarkButtonNotification
2048 object:nil
2049 userInfo:dict];
2050 EXPECT_TRUE([button isContinuousPulsing]);
2051
2052 dict = [NSDictionary dictionaryWithObjectsAndKeys:value,
2053 bookmark_button::kBookmarkKey,
2054 [NSNumber numberWithBool:NO],
2055 bookmark_button::kBookmarkPulseFlagKey,
2056 nil];
2057 [[NSNotificationCenter defaultCenter]
2058 postNotificationName:bookmark_button::kPulseBookmarkButtonNotification
2059 object:nil
2060 userInfo:dict];
2061 EXPECT_FALSE([button isContinuousPulsing]);
2062 }
2063
2029 } // namespace 2064 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_controller.mm ('k') | chrome/browser/cocoa/bookmark_bubble_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698