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

Side by Side Diff: ui/message_center/cocoa/status_item_view_unittest.mm

Issue 16073003: [Mac][MC] Allow right click to open the message center tray. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/message_center/cocoa/status_item_view.h" 5 #import "ui/message_center/cocoa/status_item_view.h"
6 6
7 #include "base/memory/scoped_nsobject.h" 7 #include "base/memory/scoped_nsobject.h"
8 #import "ui/base/test/ui_cocoa_test_helper.h" 8 #import "ui/base/test/ui_cocoa_test_helper.h"
9 9
10 class StatusItemViewTest : public ui::CocoaTest { 10 class StatusItemViewTest : public ui::CocoaTest {
(...skipping 22 matching lines...) Expand all
33 33
34 // These tests are like TEST_VIEW() but set some of the properties. 34 // These tests are like TEST_VIEW() but set some of the properties.
35 35
36 TEST_F(StatusItemViewTest, Callback) { 36 TEST_F(StatusItemViewTest, Callback) {
37 __block BOOL got_callback = NO; 37 __block BOOL got_callback = NO;
38 [view_ setCallback:^{ 38 [view_ setCallback:^{
39 got_callback = YES; 39 got_callback = YES;
40 }]; 40 }];
41 [view_ mouseDown:nil]; 41 [view_ mouseDown:nil];
42 EXPECT_TRUE(got_callback); 42 EXPECT_TRUE(got_callback);
43
44 got_callback = NO;
45 [view_ rightMouseDown:nil];
46 EXPECT_TRUE(got_callback);
43 } 47 }
44 48
45 TEST_F(StatusItemViewTest, UnreadCount) { 49 TEST_F(StatusItemViewTest, UnreadCount) {
46 [view_ setUnreadCount:2]; 50 [view_ setUnreadCount:2];
47 [view_ display]; 51 [view_ display];
48 [view_ setUnreadCount:10]; 52 [view_ setUnreadCount:10];
49 [view_ display]; 53 [view_ display];
50 [view_ setUnreadCount:0]; 54 [view_ setUnreadCount:0];
51 [view_ display]; 55 [view_ display];
52 [view_ setUnreadCount:1000]; 56 [view_ setUnreadCount:1000];
(...skipping 10 matching lines...) Expand all
63 TEST_F(StatusItemViewTest, HighlightAndMouseEvent) { 67 TEST_F(StatusItemViewTest, HighlightAndMouseEvent) {
64 [view_ mouseDown:nil]; 68 [view_ mouseDown:nil];
65 [view_ display]; 69 [view_ display];
66 [view_ setHighlight:YES]; 70 [view_ setHighlight:YES];
67 [view_ display]; 71 [view_ display];
68 [view_ mouseUp:nil]; 72 [view_ mouseUp:nil];
69 [view_ display]; 73 [view_ display];
70 [view_ setHighlight:NO]; 74 [view_ setHighlight:NO];
71 [view_ display]; 75 [view_ display];
72 } 76 }
OLDNEW
« ui/message_center/cocoa/status_item_view.mm ('K') | « ui/message_center/cocoa/status_item_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698