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

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

Issue 350002: [Mac] Adds a new view that will allow us to animate the height property of vi... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/browser/cocoa/animatable_view.mm ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
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/cocoa/animatable_view.h"
9 #import "chrome/browser/cocoa/cocoa_test_helper.h"
10 #import "chrome/browser/cocoa/view_resizer_pong.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "testing/platform_test.h"
13
14 namespace {
15
16 class AnimatableViewTest : public CocoaTest {
17 public:
18 AnimatableViewTest() {
19 NSRect frame = NSMakeRect(0, 0, 100, 100);
20 view_.reset([[AnimatableView alloc] initWithFrame:frame]);
21 [[test_window() contentView] addSubview:view_.get()];
22
23 resizeDelegate_.reset([[ViewResizerPong alloc] init]);
24 [view_ setResizeDelegate:resizeDelegate_.get()];
25 }
26
27 scoped_nsobject<ViewResizerPong> resizeDelegate_;
28 scoped_nsobject<AnimatableView> view_;
29 };
30
31 // Basic view tests (AddRemove, Display).
32 TEST_VIEW(AnimatableViewTest, view_);
33
34 TEST_F(AnimatableViewTest, GetAndSetHeight) {
35 // Make sure the view's height starts out at 100.
36 NSRect initialFrame = [view_ frame];
37 ASSERT_EQ(100, initialFrame.size.height);
38 EXPECT_EQ(initialFrame.size.height, [view_ height]);
39
40 // Set it directly to 50 and make sure it takes effect.
41 [resizeDelegate_ setHeight:-1];
42 [view_ setHeight:50];
43 EXPECT_EQ(50, [resizeDelegate_ height]);
44 }
45
46 // TODO(rohitrao): Find a way to unittest the animations and delegate messages.
47
48 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/animatable_view.mm ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698