Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / base / cocoa / nsgraphics_context_additions_unittest.mm
blobbfa17611d3d57eae2eef5009d569067ea74764f5
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
3 // found in the LICENSE file.
5 #import "ui/base/cocoa/nsgraphics_context_additions.h"
7 #include "base/mac/scoped_nsobject.h"
8 #import "ui/gfx/test/ui_cocoa_test_helper.h"
10 typedef ui::CocoaTest NSGraphicsContextCrAdditionsTest;
12 // Test fails, see http://crbug.com/249241
13 TEST_F(NSGraphicsContextCrAdditionsTest, DISABLED_PatternPhase) {
14   NSRect frame = NSMakeRect(50, 50, 100, 100);
15   base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:frame]);
16   [[test_window() contentView] addSubview:view];
18   [view lockFocus];
19   NSGraphicsContext* context = [NSGraphicsContext currentContext];
21   [context cr_setPatternPhase:NSZeroPoint forView:view];
22   EXPECT_EQ(0, [context patternPhase].y);
24   [view setWantsLayer:YES];
25   [context cr_setPatternPhase:NSZeroPoint forView:view];
26   EXPECT_EQ(-NSMinY(frame), [context patternPhase].y);
28   [view unlockFocus];