| OLD | NEW |
| 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 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 | 41 |
| 42 #define WAIT_(ex, timeout, res) \ | 42 #define WAIT_(ex, timeout, res) \ |
| 43 do { \ | 43 do { \ |
| 44 res = (ex); \ | 44 res = (ex); \ |
| 45 int64_t start = TickTime::MillisecondTimestamp(); \ | 45 int64_t start = TickTime::MillisecondTimestamp(); \ |
| 46 while (!res && TickTime::MillisecondTimestamp() < start + timeout) { \ | 46 while (!res && TickTime::MillisecondTimestamp() < start + timeout) { \ |
| 47 SleepMs(5); \ | 47 SleepMs(5); \ |
| 48 res = (ex); \ | 48 res = (ex); \ |
| 49 } \ | 49 } \ |
| 50 } while (0);\ | 50 } while (0) |
| 51 | 51 |
| 52 #define EXPECT_TRUE_WAIT(ex, timeout) \ | 52 #define EXPECT_TRUE_WAIT(ex, timeout) \ |
| 53 do { \ | 53 do { \ |
| 54 bool res; \ | 54 bool res; \ |
| 55 WAIT_(ex, timeout, res); \ | 55 WAIT_(ex, timeout, res); \ |
| 56 if (!res) EXPECT_TRUE(ex); \ | 56 if (!res) EXPECT_TRUE(ex); \ |
| 57 } while (0); | 57 } while (0) |
| 58 | 58 |
| 59 | 59 |
| 60 static const int kTimeOut = 5000; | 60 static const int kTimeOut = 5000; |
| 61 static const int kTestHeight = 288; | 61 static const int kTestHeight = 288; |
| 62 static const int kTestWidth = 352; | 62 static const int kTestWidth = 352; |
| 63 static const int kTestFramerate = 30; | 63 static const int kTestFramerate = 30; |
| 64 | 64 |
| 65 // Compares the content of two video frames. | 65 // Compares the content of two video frames. |
| 66 static bool CompareFrames(const webrtc::VideoFrame& frame1, | 66 static bool CompareFrames(const webrtc::VideoFrame& frame1, |
| 67 const webrtc::VideoFrame& frame2) { | 67 const webrtc::VideoFrame& frame2) { |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 length, capture_callback_.capability(), 0)); | 531 length, capture_callback_.capability(), 0)); |
| 532 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); | 532 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); |
| 533 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); | 533 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); |
| 534 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 534 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
| 535 length, capture_callback_.capability(), 0)); | 535 length, capture_callback_.capability(), 0)); |
| 536 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); | 536 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); |
| 537 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); | 537 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); |
| 538 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 538 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
| 539 length, capture_callback_.capability(), 0)); | 539 length, capture_callback_.capability(), 0)); |
| 540 } | 540 } |
| OLD | NEW |