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

Side by Side Diff: webrtc/modules/video_processing/main/test/unit_test/brightness_detection_test.cc

Issue 1171033002: Ensures that modules_unittests runs on iOS (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebased Created 5 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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 "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 11 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
12 #include "webrtc/modules/video_processing/main/interface/video_processing.h" 12 #include "webrtc/modules/video_processing/main/interface/video_processing.h"
13 #include "webrtc/modules/video_processing/main/test/unit_test/video_processing_u nittest.h" 13 #include "webrtc/modules/video_processing/main/test/unit_test/video_processing_u nittest.h"
14 #include "webrtc/test/testsupport/gtest_disable.h"
14 15
15 using namespace webrtc; 16 using namespace webrtc;
16 17
17 TEST_F(VideoProcessingModuleTest, BrightnessDetection) 18 TEST_F(VideoProcessingModuleTest, DISABLED_ON_IOS(BrightnessDetection))
18 { 19 {
19 uint32_t frameNum = 0; 20 uint32_t frameNum = 0;
20 int32_t brightnessWarning = 0; 21 int32_t brightnessWarning = 0;
21 uint32_t warningCount = 0; 22 uint32_t warningCount = 0;
22 rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[frame_length_]); 23 rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[frame_length_]);
23 while (fread(video_buffer.get(), 1, frame_length_, source_file_) == 24 while (fread(video_buffer.get(), 1, frame_length_, source_file_) ==
24 frame_length_) 25 frame_length_)
25 { 26 {
26 EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, 27 EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_,
27 height_, 0, kVideoRotation_0, &video_frame_)); 28 height_, 0, kVideoRotation_0, &video_frame_));
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 warningCount++; 112 warningCount++;
112 } 113 }
113 } 114 }
114 ASSERT_NE(0, feof(source_file_)) << "Error reading source file"; 115 ASSERT_NE(0, feof(source_file_)) << "Error reading source file";
115 116
116 // Expect many darkness warnings 117 // Expect many darkness warnings
117 warningProportion = static_cast<float>(warningCount) / frameNum * 100; 118 warningProportion = static_cast<float>(warningCount) / frameNum * 100;
118 printf("Dark foreman: %.1f %%\n\n", warningProportion); 119 printf("Dark foreman: %.1f %%\n\n", warningProportion);
119 EXPECT_GT(warningProportion, 90); 120 EXPECT_GT(warningProportion, 90);
120 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698