| OLD | NEW |
| 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 | 5 |
| 6 #include "base/mac/scoped_nsobject.h" | 6 #include "base/mac/scoped_nsobject.h" |
| 7 #import "chrome/browser/ui/cocoa/bubble_view.h" | 7 #import "chrome/browser/ui/cocoa/bubble_view.h" |
| 8 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 8 #include "chrome/browser/ui/cocoa/test/cocoa_test_helper.h" |
| 9 #import "testing/gtest_mac.h" | 9 #import "testing/gtest_mac.h" |
| 10 | 10 |
| 11 class BubbleViewTest : public CocoaTest { | 11 class BubbleViewTest : public CocoaTest { |
| 12 public: | 12 public: |
| 13 BubbleViewTest() { | 13 BubbleViewTest() { |
| 14 NSRect frame = NSMakeRect(0, 0, 50, 50); | 14 NSRect frame = NSMakeRect(0, 0, 50, 50); |
| 15 base::scoped_nsobject<BubbleView> view( | 15 base::scoped_nsobject<BubbleView> view( |
| 16 [[BubbleView alloc] initWithFrame:frame themeProvider:test_window()]); | 16 [[BubbleView alloc] initWithFrame:frame themeProvider:test_window()]); |
| 17 view_ = view.get(); | 17 view_ = view.get(); |
| 18 [[test_window() contentView] addSubview:view_]; | 18 [[test_window() contentView] addSubview:view_]; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 49 [view_ setCornerFlags:kRoundedTopRightCorner | kRoundedTopLeftCorner]; | 49 [view_ setCornerFlags:kRoundedTopRightCorner | kRoundedTopLeftCorner]; |
| 50 EXPECT_EQ([view_ cornerFlags], | 50 EXPECT_EQ([view_ cornerFlags], |
| 51 (unsigned long)kRoundedTopRightCorner | kRoundedTopLeftCorner); | 51 (unsigned long)kRoundedTopRightCorner | kRoundedTopLeftCorner); |
| 52 // Set no flags (all 4 draw corners are square). | 52 // Set no flags (all 4 draw corners are square). |
| 53 [view_ setCornerFlags:0]; | 53 [view_ setCornerFlags:0]; |
| 54 EXPECT_EQ([view_ cornerFlags], 0UL); | 54 EXPECT_EQ([view_ cornerFlags], 0UL); |
| 55 // Set all bits. Meaningless past the first 4, but harmless to set too many. | 55 // Set all bits. Meaningless past the first 4, but harmless to set too many. |
| 56 [view_ setCornerFlags:0xFFFFFFFF]; | 56 [view_ setCornerFlags:0xFFFFFFFF]; |
| 57 EXPECT_EQ([view_ cornerFlags], 0xFFFFFFFF); | 57 EXPECT_EQ([view_ cornerFlags], 0xFFFFFFFF); |
| 58 } | 58 } |
| OLD | NEW |