OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "ios/chrome/browser/suggestions/ios_image_decoder_impl.h" | 5 #import "ios/chrome/browser/suggestions/ios_image_decoder_impl.h" |
6 | 6 |
7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
15 #include "ui/gfx/image/image.h" | 15 #include "ui/gfx/image/image.h" |
16 | 16 |
| 17 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 18 #error "This file requires ARC support." |
| 19 #endif |
| 20 |
17 namespace { | 21 namespace { |
18 | 22 |
19 static unsigned char kJPGImage[] = { | 23 static unsigned char kJPGImage[] = { |
20 255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, | 24 255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, |
21 72, 0, 72, 0, 0, 255, 254, 0, 19, 67, 114, 101, 97, 116, 101, | 25 72, 0, 72, 0, 0, 255, 254, 0, 19, 67, 114, 101, 97, 116, 101, |
22 100, 32, 119, 105, 116, 104, 32, 71, 73, 77, 80, 255, 219, 0, 67, | 26 100, 32, 119, 105, 116, 104, 32, 71, 73, 77, 80, 255, 219, 0, 67, |
23 0, 5, 3, 4, 4, 4, 3, 5, 4, 4, 4, 5, 5, 5, 6, | 27 0, 5, 3, 4, 4, 4, 3, 5, 4, 4, 4, 5, 5, 5, 6, |
24 7, 12, 8, 7, 7, 7, 7, 15, 11, 11, 9, 12, 17, 15, 18, | 28 7, 12, 8, 7, 7, 7, 7, 15, 11, 11, 9, 12, 17, 15, 18, |
25 18, 17, 15, 17, 17, 19, 22, 28, 23, 19, 20, 26, 21, 17, 17, | 29 18, 17, 15, 17, 17, 19, 22, 28, 23, 19, 20, 26, 21, 17, 17, |
26 24, 33, 24, 26, 29, 29, 31, 31, 31, 19, 23, 34, 36, 34, 30, | 30 24, 33, 24, 26, 29, 29, 31, 31, 31, 19, 23, 34, 36, 34, 30, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 image_data, base::Bind(&IOSImageDecoderImplTest::OnImageDecoded, | 99 image_data, base::Bind(&IOSImageDecoderImplTest::OnImageDecoded, |
96 base::Unretained(this))); | 100 base::Unretained(this))); |
97 | 101 |
98 pool_->FlushForTesting(); | 102 pool_->FlushForTesting(); |
99 base::RunLoop().RunUntilIdle(); | 103 base::RunLoop().RunUntilIdle(); |
100 | 104 |
101 EXPECT_FALSE(decoded_image_.IsEmpty()); | 105 EXPECT_FALSE(decoded_image_.IsEmpty()); |
102 } | 106 } |
103 | 107 |
104 } // namespace suggestions | 108 } // namespace suggestions |
OLD | NEW |