OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <QuartzCore/QuartzCore.h> | 5 #import <QuartzCore/QuartzCore.h> |
6 #import <UIKit/UIKit.h> | 6 #import <UIKit/UIKit.h> |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/mac/scoped_cftyperef.h" | 9 #include "base/mac/scoped_cftyperef.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 CGBitmapContextCreateImage(context)); | 39 CGBitmapContextCreateImage(context)); |
40 return [UIImage imageWithCGImage:cg_image | 40 return [UIImage imageWithCGImage:cg_image |
41 scale:scale | 41 scale:scale |
42 orientation:UIImageOrientationUp]; | 42 orientation:UIImageOrientationUp]; |
43 } | 43 } |
44 | 44 |
45 | 45 |
46 class ImageIOSTest : public testing::Test { | 46 class ImageIOSTest : public testing::Test { |
47 public: | 47 public: |
48 ImageIOSTest() {} | 48 ImageIOSTest() {} |
49 virtual ~ImageIOSTest() {} | 49 ~ImageIOSTest() override {} |
50 | 50 |
51 virtual void SetUp() override { | 51 void SetUp() override { |
52 original_scale_factors_ = gfx::ImageSkia::GetSupportedScales(); | 52 original_scale_factors_ = gfx::ImageSkia::GetSupportedScales(); |
53 } | 53 } |
54 | 54 |
55 virtual void TearDown() override { | 55 void TearDown() override { |
56 gfx::ImageSkia::SetSupportedScales(original_scale_factors_); | 56 gfx::ImageSkia::SetSupportedScales(original_scale_factors_); |
57 } | 57 } |
58 | 58 |
59 private: | 59 private: |
60 // Used to save and restore the scale factors in effect before this test. | 60 // Used to save and restore the scale factors in effect before this test. |
61 std::vector<float> original_scale_factors_; | 61 std::vector<float> original_scale_factors_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(ImageIOSTest); | 63 DISALLOW_COPY_AND_ASSIGN(ImageIOSTest); |
64 }; | 64 }; |
65 | 65 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 EXPECT_EQ(kWidth, imageskia->width()); | 100 EXPECT_EQ(kWidth, imageskia->width()); |
101 EXPECT_EQ(kHeight, imageskia->height()); | 101 EXPECT_EQ(kHeight, imageskia->height()); |
102 | 102 |
103 // TODO(rohitrao): Convert from ImageSkia back to UIImage. This should | 103 // TODO(rohitrao): Convert from ImageSkia back to UIImage. This should |
104 // scale the image based on the current set of supported scales. | 104 // scale the image based on the current set of supported scales. |
105 } | 105 } |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 } // namespace | 109 } // namespace |
OLD | NEW |