| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/base/cocoa/nsgraphics_context_additions.h" | 5 #import "ui/base/cocoa/nsgraphics_context_additions.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #import "ui/base/test/ui_cocoa_test_helper.h" | 8 #import "ui/base/test/ui_cocoa_test_helper.h" |
| 9 | 9 |
| 10 typedef ui::CocoaTest NSGraphicsContextCrAdditionsTest; | 10 typedef ui::CocoaTest NSGraphicsContextCrAdditionsTest; |
| 11 | 11 |
| 12 // Test fails, see http://crbug.com/249241 | 12 // Test fails, see http://crbug.com/249241 |
| 13 TEST_F(NSGraphicsContextCrAdditionsTest, DISABLED_PatternPhase) { | 13 TEST_F(NSGraphicsContextCrAdditionsTest, DISABLED_PatternPhase) { |
| 14 NSRect frame = NSMakeRect(50, 50, 100, 100); | 14 NSRect frame = NSMakeRect(50, 50, 100, 100); |
| 15 scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:frame]); | 15 base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:frame]); |
| 16 [[test_window() contentView] addSubview:view]; | 16 [[test_window() contentView] addSubview:view]; |
| 17 | 17 |
| 18 [view lockFocus]; | 18 [view lockFocus]; |
| 19 NSGraphicsContext* context = [NSGraphicsContext currentContext]; | 19 NSGraphicsContext* context = [NSGraphicsContext currentContext]; |
| 20 | 20 |
| 21 [context cr_setPatternPhase:NSZeroPoint forView:view]; | 21 [context cr_setPatternPhase:NSZeroPoint forView:view]; |
| 22 EXPECT_EQ(0, [context patternPhase].y); | 22 EXPECT_EQ(0, [context patternPhase].y); |
| 23 | 23 |
| 24 [view setWantsLayer:YES]; | 24 [view setWantsLayer:YES]; |
| 25 [context cr_setPatternPhase:NSZeroPoint forView:view]; | 25 [context cr_setPatternPhase:NSZeroPoint forView:view]; |
| 26 EXPECT_EQ(-NSMinY(frame), [context patternPhase].y); | 26 EXPECT_EQ(-NSMinY(frame), [context patternPhase].y); |
| 27 | 27 |
| 28 [view unlockFocus]; | 28 [view unlockFocus]; |
| 29 } | 29 } |
| OLD | NEW |