Chromium Code Reviews

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc

Issue 1547343002: Remove DISABLED_ON_ macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: win compile Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include <stdio.h> 11 #include <stdio.h>
12 12
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 #include "webrtc/base/checks.h" 14 #include "webrtc/base/checks.h"
15 #include "webrtc/base/scoped_ptr.h" 15 #include "webrtc/base/scoped_ptr.h"
16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
17 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" 17 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
18 #include "webrtc/system_wrappers/include/tick_util.h" 18 #include "webrtc/system_wrappers/include/tick_util.h"
19 #include "webrtc/test/testsupport/fileutils.h" 19 #include "webrtc/test/testsupport/fileutils.h"
20 #include "webrtc/test/testsupport/gtest_disable.h"
21 20
22 namespace webrtc { 21 namespace webrtc {
23 22
24 enum { kMaxWaitEncTimeMs = 100 }; 23 enum { kMaxWaitEncTimeMs = 100 };
25 enum { kMaxWaitDecTimeMs = 25 }; 24 enum { kMaxWaitDecTimeMs = 25 };
26 25
27 static const uint32_t kTestTimestamp = 123; 26 static const uint32_t kTestTimestamp = 123;
28 static const int64_t kTestNtpTimeMs = 456; 27 static const int64_t kTestNtpTimeMs = 456;
29 28
30 // TODO(mikhal): Replace these with mocks. 29 // TODO(mikhal): Replace these with mocks.
(...skipping 183 matching lines...)
214 encoder_->SetRates(bit_rate, codec_inst_.maxFramerate)); 213 encoder_->SetRates(bit_rate, codec_inst_.maxFramerate));
215 214
216 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, encoder_->InitEncode(&codec_inst_, 1, 1440)); 215 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, encoder_->InitEncode(&codec_inst_, 1, 1440));
217 216
218 // Decoder parameter tests. 217 // Decoder parameter tests.
219 // Calls before InitDecode(). 218 // Calls before InitDecode().
220 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->Release()); 219 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->Release());
221 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->InitDecode(&codec_inst_, 1)); 220 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->InitDecode(&codec_inst_, 1));
222 } 221 }
223 222
224 TEST_F(TestVp8Impl, DISABLED_ON_ANDROID(AlignedStrideEncodeDecode)) { 223 #if defined(WEBRTC_ANDROID)
224 TEST_F(TestVp8Impl, DISABLED_AlignedStrideEncodeDecode) {
225 #else
226 TEST_F(TestVp8Impl, AlignedStrideEncodeDecode) {
227 #endif
225 SetUpEncodeDecode(); 228 SetUpEncodeDecode();
226 encoder_->Encode(input_frame_, NULL, NULL); 229 encoder_->Encode(input_frame_, NULL, NULL);
227 EXPECT_GT(WaitForEncodedFrame(), 0u); 230 EXPECT_GT(WaitForEncodedFrame(), 0u);
228 // First frame should be a key frame. 231 // First frame should be a key frame.
229 encoded_frame_._frameType = kVideoFrameKey; 232 encoded_frame_._frameType = kVideoFrameKey;
230 encoded_frame_.ntp_time_ms_ = kTestNtpTimeMs; 233 encoded_frame_.ntp_time_ms_ = kTestNtpTimeMs;
231 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, 234 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
232 decoder_->Decode(encoded_frame_, false, NULL)); 235 decoder_->Decode(encoded_frame_, false, NULL));
233 EXPECT_GT(WaitForDecodedFrame(), 0u); 236 EXPECT_GT(WaitForDecodedFrame(), 0u);
234 // Compute PSNR on all planes (faster than SSIM). 237 // Compute PSNR on all planes (faster than SSIM).
235 EXPECT_GT(I420PSNR(&input_frame_, &decoded_frame_), 36); 238 EXPECT_GT(I420PSNR(&input_frame_, &decoded_frame_), 36);
236 EXPECT_EQ(kTestTimestamp, decoded_frame_.timestamp()); 239 EXPECT_EQ(kTestTimestamp, decoded_frame_.timestamp());
237 EXPECT_EQ(kTestNtpTimeMs, decoded_frame_.ntp_time_ms()); 240 EXPECT_EQ(kTestNtpTimeMs, decoded_frame_.ntp_time_ms());
238 } 241 }
239 242
240 TEST_F(TestVp8Impl, DISABLED_ON_ANDROID(DecodeWithACompleteKeyFrame)) { 243 #if defined(WEBRTC_ANDROID)
244 TEST_F(TestVp8Impl, DISABLED_DecodeWithACompleteKeyFrame) {
245 #else
246 TEST_F(TestVp8Impl, DecodeWithACompleteKeyFrame) {
247 #endif
241 SetUpEncodeDecode(); 248 SetUpEncodeDecode();
242 encoder_->Encode(input_frame_, NULL, NULL); 249 encoder_->Encode(input_frame_, NULL, NULL);
243 EXPECT_GT(WaitForEncodedFrame(), 0u); 250 EXPECT_GT(WaitForEncodedFrame(), 0u);
244 // Setting complete to false -> should return an error. 251 // Setting complete to false -> should return an error.
245 encoded_frame_._completeFrame = false; 252 encoded_frame_._completeFrame = false;
246 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, 253 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR,
247 decoder_->Decode(encoded_frame_, false, NULL)); 254 decoder_->Decode(encoded_frame_, false, NULL));
248 // Setting complete back to true. Forcing a delta frame. 255 // Setting complete back to true. Forcing a delta frame.
249 encoded_frame_._frameType = kVideoFrameDelta; 256 encoded_frame_._frameType = kVideoFrameDelta;
250 encoded_frame_._completeFrame = true; 257 encoded_frame_._completeFrame = true;
(...skipping 18 matching lines...)
269 276
270 EXPECT_EQ(0, decoder_->Decode(encoded_frame_, false, NULL)); 277 EXPECT_EQ(0, decoder_->Decode(encoded_frame_, false, NULL));
271 rtc::scoped_ptr<uint8_t[]> second_frame_buffer(new uint8_t[length]); 278 rtc::scoped_ptr<uint8_t[]> second_frame_buffer(new uint8_t[length]);
272 ExtractBuffer(decoded_frame_, length, second_frame_buffer.get()); 279 ExtractBuffer(decoded_frame_, length, second_frame_buffer.get());
273 280
274 EXPECT_EQ( 281 EXPECT_EQ(
275 0, memcmp(second_frame_buffer.get(), first_frame_buffer.get(), length)); 282 0, memcmp(second_frame_buffer.get(), first_frame_buffer.get(), length));
276 } 283 }
277 284
278 } // namespace webrtc 285 } // namespace webrtc
OLDNEW

Powered by Google App Engine