OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
9 #import "chrome/browser/ui/cocoa/sprite_view.h" | 9 #import "chrome/browser/ui/cocoa/sprite_view.h" |
10 #include "grit/ui_resources.h" | |
11 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "testing/platform_test.h" | 11 #include "testing/platform_test.h" |
13 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
14 #include "ui/gfx/image/image.h" | 13 #include "ui/gfx/image/image.h" |
| 14 #include "ui/resources/grit/ui_resources.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 class SpriteViewTest : public CocoaTest { | 18 class SpriteViewTest : public CocoaTest { |
19 public: | 19 public: |
20 SpriteViewTest() { | 20 SpriteViewTest() { |
21 image_.reset(ResourceBundle::GetSharedInstance() | 21 image_.reset(ResourceBundle::GetSharedInstance() |
22 .GetNativeImageNamed(IDR_THROBBER) | 22 .GetNativeImageNamed(IDR_THROBBER) |
23 .CopyNSImage()); | 23 .CopyNSImage()); |
24 view_.reset([[SpriteView alloc] init]); | 24 view_.reset([[SpriteView alloc] init]); |
(...skipping 10 matching lines...) Expand all Loading... |
35 TEST_F(SpriteViewTest, TestViewFrame) { | 35 TEST_F(SpriteViewTest, TestViewFrame) { |
36 NSSize imageSize = [image_ size]; | 36 NSSize imageSize = [image_ size]; |
37 NSRect frame = [view_ frame]; | 37 NSRect frame = [view_ frame]; |
38 EXPECT_EQ(0.0, frame.origin.x); | 38 EXPECT_EQ(0.0, frame.origin.x); |
39 EXPECT_EQ(0.0, frame.origin.y); | 39 EXPECT_EQ(0.0, frame.origin.y); |
40 EXPECT_EQ(imageSize.height, NSWidth(frame)); | 40 EXPECT_EQ(imageSize.height, NSWidth(frame)); |
41 EXPECT_EQ(imageSize.height, NSHeight(frame)); | 41 EXPECT_EQ(imageSize.height, NSHeight(frame)); |
42 } | 42 } |
43 | 43 |
44 } // namespace | 44 } // namespace |
OLD | NEW |