OLD | NEW |
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 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "remoting/base/util.h" | 7 #include "remoting/base/util.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "third_party/skia/include/core/SkRect.h" | 9 #include "third_party/skia/include/core/SkRect.h" |
10 #include "third_party/skia/include/core/SkSize.h" | 10 #include "third_party/skia/include/core/SkSize.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 CheckRgbBuffer(rect); | 121 CheckRgbBuffer(rect); |
122 } | 122 } |
123 | 123 |
124 void TestBasicConversion() { | 124 void TestBasicConversion() { |
125 // Whole buffer. | 125 // Whole buffer. |
126 RunTest(SkISize::Make(kWidth, kHeight), SkIRect::MakeWH(kWidth, kHeight)); | 126 RunTest(SkISize::Make(kWidth, kHeight), SkIRect::MakeWH(kWidth, kHeight)); |
127 } | 127 } |
128 | 128 |
129 private: | 129 private: |
130 size_t yuv_buffer_size_; | 130 size_t yuv_buffer_size_; |
131 scoped_array<uint8> yuv_buffer_; | 131 scoped_ptr<uint8[]> yuv_buffer_; |
132 uint8* yplane_; | 132 uint8* yplane_; |
133 uint8* uplane_; | 133 uint8* uplane_; |
134 uint8* vplane_; | 134 uint8* vplane_; |
135 | 135 |
136 size_t rgb_buffer_size_; | 136 size_t rgb_buffer_size_; |
137 scoped_array<uint8> rgb_buffer_; | 137 scoped_ptr<uint8[]> rgb_buffer_; |
138 | 138 |
139 DISALLOW_COPY_AND_ASSIGN(YuvToRgbTester); | 139 DISALLOW_COPY_AND_ASSIGN(YuvToRgbTester); |
140 }; | 140 }; |
141 | 141 |
142 TEST(YuvToRgbTest, BasicConversion) { | 142 TEST(YuvToRgbTest, BasicConversion) { |
143 YuvToRgbTester tester; | 143 YuvToRgbTester tester; |
144 tester.TestBasicConversion(); | 144 tester.TestBasicConversion(); |
145 } | 145 } |
146 | 146 |
147 TEST(YuvToRgbTest, Clipping) { | 147 TEST(YuvToRgbTest, Clipping) { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 EXPECT_FALSE(StringIsUtf8("\xfe\x80\x80\x80\x80\x80\x80", 7)); | 281 EXPECT_FALSE(StringIsUtf8("\xfe\x80\x80\x80\x80\x80\x80", 7)); |
282 EXPECT_FALSE(StringIsUtf8("\xff\x80\x80\x80\x80\x80\x80", 7)); | 282 EXPECT_FALSE(StringIsUtf8("\xff\x80\x80\x80\x80\x80\x80", 7)); |
283 | 283 |
284 // Invalid continuation byte | 284 // Invalid continuation byte |
285 EXPECT_FALSE(StringIsUtf8("\xc0\x00", 2)); | 285 EXPECT_FALSE(StringIsUtf8("\xc0\x00", 2)); |
286 EXPECT_FALSE(StringIsUtf8("\xc0\x40", 2)); | 286 EXPECT_FALSE(StringIsUtf8("\xc0\x40", 2)); |
287 EXPECT_FALSE(StringIsUtf8("\xc0\xc0", 2)); | 287 EXPECT_FALSE(StringIsUtf8("\xc0\xc0", 2)); |
288 } | 288 } |
289 | 289 |
290 } // namespace remoting | 290 } // namespace remoting |
OLD | NEW |