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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/throbbing_image_view_unittest.mm

Issue 13867007: Tab audio indicator: Use animation container on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/tabs/throbbing_image_view.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/cocoa/tabs/throbbing_image_view.h" 5 #import "chrome/browser/ui/cocoa/tabs/throbbing_image_view.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" 8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/platform_test.h" 10 #include "testing/platform_test.h"
11 11
12 namespace { 12 namespace {
13 13
14 class ThrobbingImageViewTest : public CocoaTest { 14 class ThrobbingImageViewTest : public CocoaTest {
15 public: 15 public:
16 ThrobbingImageViewTest() { 16 ThrobbingImageViewTest() {
17 scoped_nsobject<NSImage> image( 17 scoped_nsobject<NSImage> image(
18 [[NSImage alloc] initWithSize:NSMakeSize(16, 16)]); 18 [[NSImage alloc] initWithSize:NSMakeSize(16, 16)]);
19 [image lockFocus]; 19 [image lockFocus];
20 NSRectFill(NSMakeRect(0, 0, 16, 16)); 20 NSRectFill(NSMakeRect(0, 0, 16, 16));
21 [image unlockFocus]; 21 [image unlockFocus];
22 22
23 scoped_nsobject<ThrobbingImageView> view([[ThrobbingImageView alloc] 23 scoped_nsobject<ThrobbingImageView> view([[ThrobbingImageView alloc]
24 initWithFrame:NSMakeRect(0, 0, 16, 16) 24 initWithFrame:NSMakeRect(0, 0, 16, 16)
25 backgroundImage:image 25 backgroundImage:image
26 throbImage:image 26 throbImage:image
27 durationMS:20 27 durationMS:20
28 throbPosition:kThrobPositionOverlay]); 28 throbPosition:kThrobPositionOverlay
29 animationContainer:NULL]);
29 view_ = view.get(); 30 view_ = view.get();
30 [[test_window() contentView] addSubview:view_]; 31 [[test_window() contentView] addSubview:view_];
31 } 32 }
32 33
33 MessageLoopForUI message_loop_; // Needed for ui::ThrobAnimation. 34 MessageLoopForUI message_loop_; // Needed for ui::ThrobAnimation.
34 ThrobbingImageView* view_; 35 ThrobbingImageView* view_;
35 }; 36 };
36 37
37 TEST_VIEW(ThrobbingImageViewTest, view_) 38 TEST_VIEW(ThrobbingImageViewTest, view_)
38 39
39 } // namespace 40 } // namespace
40 41
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/throbbing_image_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698