Don't crash the test process when X11 isn't available.
It's not great to use asserts in util functions like this because it breaks the arrange-act-assert rule, but using checks is worse because they will crash the test process on failure (= no other tests get run after that). Bug: b/143587130 Change-Id: If4d085311de0792b9fca1584db299fd24199e72e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162360 Reviewed-by: Artem Titov <titovartem@webrtc.org> Commit-Queue: Patrik Höglund <phoglund@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30093}
This commit is contained in:
committed by
Commit Bot
parent
774fb933a3
commit
73eb784676
@ -24,8 +24,8 @@ namespace {
|
||||
void PaintDesktopFrame(DesktopFrame* frame,
|
||||
DesktopVector pos,
|
||||
RgbaColor color) {
|
||||
RTC_DCHECK(frame);
|
||||
RTC_DCHECK(DesktopRect::MakeSize(frame->size()).Contains(pos));
|
||||
ASSERT_TRUE(frame);
|
||||
ASSERT_TRUE(DesktopRect::MakeSize(frame->size()).Contains(pos));
|
||||
*reinterpret_cast<uint32_t*>(frame->GetFrameDataAtPos(pos)) =
|
||||
color.ToUInt32();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user