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

Side by Side Diff: chrome/browser/ui/cocoa/tab_view_unittest.mm

Issue 6362007: [Mac] Organize all tab/tab strip files into chrome/browser/ui/cocoa/tabs/.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
« no previous file with comments | « chrome/browser/ui/cocoa/tab_view.mm ('k') | chrome/browser/ui/cocoa/tab_window_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #import <Cocoa/Cocoa.h>
6
7 #include "base/scoped_nsobject.h"
8 #import "chrome/browser/ui/cocoa/tab_view.h"
9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "testing/platform_test.h"
12
13 namespace {
14
15 class TabViewTest : public CocoaTest {
16 public:
17 TabViewTest() {
18 NSRect frame = NSMakeRect(0, 0, 50, 30);
19 scoped_nsobject<TabView> view([[TabView alloc] initWithFrame:frame]);
20 view_ = view.get();
21 [[test_window() contentView] addSubview:view_];
22 }
23
24 TabView* view_;
25 };
26
27 TEST_VIEW(TabViewTest, view_)
28
29 // Test drawing, mostly to ensure nothing leaks or crashes.
30 TEST_F(TabViewTest, Display) {
31 for (int i = 0; i < 5; i++) {
32 for (int j = 0; j < 5; j++) {
33 [view_ setHoverAlpha:i*0.2];
34 [view_ setAlertAlpha:j*0.2];
35 [view_ display];
36 }
37 }
38 }
39
40 // Test it doesn't crash when asked for its menu with no TabController set.
41 TEST_F(TabViewTest, Menu) {
42 EXPECT_FALSE([view_ menu]);
43 }
44
45 TEST_F(TabViewTest, Glow) {
46 // TODO(viettrungluu): Figure out how to test this, which is timing-sensitive
47 // and which moreover uses |-performSelector:withObject:afterDelay:|.
48
49 // Call |-startAlert|/|-cancelAlert| and make sure it doesn't crash.
50 for (int i = 0; i < 5; i++) {
51 [view_ startAlert];
52 [view_ cancelAlert];
53 }
54 [view_ startAlert];
55 [view_ startAlert];
56 [view_ cancelAlert];
57 [view_ cancelAlert];
58 }
59
60 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tab_view.mm ('k') | chrome/browser/ui/cocoa/tab_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698