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

Side by Side Diff: chrome/browser/ui/tests/ui_gfx_image_unittest.mm

Issue 12794013: Temporarily disabled tests failing on 10.8, when running on 10.8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review feedback. Created 7 years, 9 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/ssl_client_certificate_selector_cocoa_browsertest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <AppKit/AppKit.h> 5 #import <AppKit/AppKit.h>
6 6
7 #import "base/mac/mac_util.h"
7 #include "base/memory/scoped_nsobject.h" 8 #include "base/memory/scoped_nsobject.h"
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" 9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
9 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 11 #include "third_party/skia/include/core/SkBitmap.h"
11 #include "ui/gfx/image/image.h" 12 #include "ui/gfx/image/image.h"
12 #include "ui/gfx/image/image_unittest_util.h" 13 #include "ui/gfx/image/image_unittest_util.h"
13 14
14 namespace { 15 namespace {
15 16
16 class UiGfxImageTest : public CocoaTest { 17 class UiGfxImageTest : public CocoaTest {
17 }; 18 };
18 19
19 TEST_F(UiGfxImageTest, CheckColor) { 20 TEST_F(UiGfxImageTest, CheckColor) {
21 // TODO(kbr): re-enable: http://crbug.com/222296
22 if (base::mac::IsOSMountainLionOrLater())
23 return;
24
20 gfx::Image image = gfx::Image::CreateFrom1xBitmap( 25 gfx::Image image = gfx::Image::CreateFrom1xBitmap(
21 gfx::test::CreateBitmap(25, 25)); 26 gfx::test::CreateBitmap(25, 25));
22 NSImage* ns_image = image.ToNSImage(); 27 NSImage* ns_image = image.ToNSImage();
23 [ns_image lockFocus]; 28 [ns_image lockFocus];
24 NSColor* color = NSReadPixel(NSMakePoint(10, 10)); 29 NSColor* color = NSReadPixel(NSMakePoint(10, 10));
25 [ns_image unlockFocus]; 30 [ns_image unlockFocus];
26 31
27 // SkBitmapToNSImage returns a bitmap in the calibrated color space (sRGB), 32 // SkBitmapToNSImage returns a bitmap in the calibrated color space (sRGB),
28 // while NSReadPixel returns a color in the device color space. Convert back 33 // while NSReadPixel returns a color in the device color space. Convert back
29 // to the calibrated color space before testing. 34 // to the calibrated color space before testing.
(...skipping 13 matching lines...) Expand all
43 [[NSImageView alloc] initWithFrame:NSMakeRect(10, 10, 25, 25)]); 48 [[NSImageView alloc] initWithFrame:NSMakeRect(10, 10, 25, 25)]);
44 [[test_window() contentView] addSubview:image_view]; 49 [[test_window() contentView] addSubview:image_view];
45 [test_window() orderFront:nil]; 50 [test_window() orderFront:nil];
46 51
47 gfx::Image image = gfx::Image::CreateFrom1xBitmap( 52 gfx::Image image = gfx::Image::CreateFrom1xBitmap(
48 gfx::test::CreateBitmap(25, 25)); 53 gfx::test::CreateBitmap(25, 25));
49 [image_view setImage:image.ToNSImage()]; 54 [image_view setImage:image.ToNSImage()];
50 } 55 }
51 56
52 } // namespace 57 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa_browsertest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698