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

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

Issue 118095: Display a tooltip when mousing over a tab title. (Closed)
Patch Set: now with unit test goodness Created 11 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
« no previous file with comments | « chrome/browser/cocoa/tab_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/scoped_nsautorelease_pool.h" 7 #include "base/scoped_nsautorelease_pool.h"
8 #import "base/scoped_nsobject.h" 8 #import "base/scoped_nsobject.h"
9 #import "chrome/browser/cocoa/tab_controller.h" 9 #import "chrome/browser/cocoa/tab_controller.h"
10 #import "chrome/browser/cocoa/tab_controller_target.h" 10 #import "chrome/browser/cocoa/tab_controller_target.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 scoped_nsobject<TabController> controller([[TabController alloc] init]); 100 scoped_nsobject<TabController> controller([[TabController alloc] init]);
101 [[window contentView] addSubview:[controller view]]; 101 [[window contentView] addSubview:[controller view]];
102 102
103 EXPECT_FALSE([controller selected]); 103 EXPECT_FALSE([controller selected]);
104 [controller setSelected:YES]; 104 [controller setSelected:YES];
105 EXPECT_TRUE([controller selected]); 105 EXPECT_TRUE([controller selected]);
106 106
107 [[controller view] removeFromSuperview]; 107 [[controller view] removeFromSuperview];
108 } 108 }
109 109
110 // Tests that setting the title of a tab sets the tooltip as well.
John Grabowski 2009/06/02 00:10:51 u de man jeremy.
111 TEST_F(TabControllerTest, ToolTip) {
112 NSWindow* window = cocoa_helper_.window();
113
114 scoped_nsobject<TabController> controller([[TabController alloc] init]);
115 [[window contentView] addSubview:[controller view]];
116
117 EXPECT_TRUE([[controller toolTip] length] == 0);
118 NSString *tooltip_string = @"Some text to use as a tab title";
119 [controller setTitle:tooltip_string];
120 EXPECT_TRUE([tooltip_string isEqualToString:[controller toolTip]]);
121 }
122
110 // Tests setting the |loading| property via code. 123 // Tests setting the |loading| property via code.
111 TEST_F(TabControllerTest, Loading) { 124 TEST_F(TabControllerTest, Loading) {
112 NSWindow* window = cocoa_helper_.window(); 125 NSWindow* window = cocoa_helper_.window();
113 scoped_nsobject<TabController> controller([[TabController alloc] init]); 126 scoped_nsobject<TabController> controller([[TabController alloc] init]);
114 [[window contentView] addSubview:[controller view]]; 127 [[window contentView] addSubview:[controller view]];
115 128
116 EXPECT_FALSE([controller loading]); 129 EXPECT_FALSE([controller loading]);
117 [controller setLoading:YES]; 130 [controller setLoading:YES];
118 EXPECT_TRUE([controller loading]); 131 EXPECT_TRUE([controller loading]);
119 132
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 pressure:1.0]; 183 pressure:1.0];
171 [[controller view] mouseDown:down]; 184 [[controller view] mouseDown:down];
172 185
173 // Check our target was told the tab got selected. 186 // Check our target was told the tab got selected.
174 EXPECT_TRUE([target selected]); 187 EXPECT_TRUE([target selected]);
175 188
176 [[controller view] removeFromSuperview]; 189 [[controller view] removeFromSuperview];
177 } 190 }
178 191
179 } // namespace 192 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/tab_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698