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

Unified Diff: webrtc/modules/desktop_capture/screen_capturer_integration_test.cc

Issue 2492723002: Add more logging in ScreenCapturerIntegrationTest (Closed)
Patch Set: Resolve review comments Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/desktop_capture/screen_drawer_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/screen_capturer_integration_test.cc
diff --git a/webrtc/modules/desktop_capture/screen_capturer_integration_test.cc b/webrtc/modules/desktop_capture/screen_capturer_integration_test.cc
index 64fdd4a08468b15916934db0f57aeb88e915e267..355f62dfa5608cb3e5f9fef1891368324e340f29 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_integration_test.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_integration_test.cc
@@ -12,9 +12,12 @@
#include <algorithm>
#include <initializer_list>
+#include <iostream> // TODO(zijiehe): Remove once flaky has been resolved.
#include <memory>
#include <utility>
+// TODO(zijiehe): Remove once flaky has been resolved.
+#include "webrtc/base/base64.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/logging.h"
@@ -116,7 +119,9 @@ class ScreenCapturerIntegrationTest : public testing::Test {
RgbaColor color((c == 0 ? (i & 0xff) : 0x7f),
(c == 1 ? (i & 0xff) : 0x7f),
(c == 2 ? (i & 0xff) : 0x7f));
- TestCaptureOneFrame(capturers, drawer.get(), rect, color);
+ // Fail fast.
+ ASSERT_NO_FATAL_FAILURE(
+ TestCaptureOneFrame(capturers, drawer.get(), rect, color));
}
// A variable-size rectangle.
@@ -126,7 +131,9 @@ class ScreenCapturerIntegrationTest : public testing::Test {
RgbaColor color((c == 0 ? (i & 0xff) : 0x7f),
(c == 1 ? (i & 0xff) : 0x7f),
(c == 2 ? (i & 0xff) : 0x7f));
- TestCaptureOneFrame(capturers, drawer.get(), rect, color);
+ // Fail fast.
+ ASSERT_NO_FATAL_FAILURE(
+ TestCaptureOneFrame(capturers, drawer.get(), rect, color));
}
}
}
@@ -183,14 +190,14 @@ class ScreenCapturerIntegrationTest : public testing::Test {
for (size_t j = 0; j < capturers.size(); j++) {
if (capturers[j] == nullptr) {
// DesktopCapturer should return an empty updated_region() if no
- // update detected. So we won't test it again if it has captured
- // the rectangle we drew.
+ // update detected. So we won't test it again if it has captured the
+ // rectangle we drew.
continue;
}
std::unique_ptr<DesktopFrame> frame = CaptureFrame(capturers[j]);
if (!frame) {
- // CaptureFrame() has triggered an assertion failure already, we
- // only need to return here.
+ // CaptureFrame() has triggered an assertion failure already, we only
+ // need to return here.
return;
}
@@ -199,6 +206,35 @@ class ScreenCapturerIntegrationTest : public testing::Test {
capturers[j] = nullptr;
succeeded_capturers++;
}
+ // The following else if statement is for debugging purpose only, which
+ // should be removed after flaky of ScreenCapturerIntegrationTest has
+ // been resolved.
+ else if (i == wait_capture_round - 1) {
+ std::string result;
+ rtc::Base64::EncodeFromArray(frame->data(),
+ frame->size().height() * frame->stride(),
+ &result);
+ std::cout << frame->size().width() << " x " << frame->size().height()
+ << std::endl;
+ // Split the entire string (can be over 4M) into several lines to
+ // avoid browser from stucking.
+ static const size_t kLineLength = 32768;
+ const char* result_end = result.c_str() + result.length();
+ for (const char* it = result.c_str();
+ it < result_end;
+ it += kLineLength) {
+ const size_t max_length = result_end - it;
+ std::cout << std::string(it, std::min(kLineLength, max_length))
+ << std::endl;
+ }
+ ASSERT_TRUE(false) << "ScreenCapturerIntegrationTest may be flaky. "
+ "Please kindly FYI the broken link to "
+ "zijiehe@chromium.org for investigation. If I "
+ "have not responded as quick as expected, "
+ "disable *all* tests in "
+ "screen_capturer_integration_test.cc to "
+ "unblock other developers.";
+ }
}
if (succeeded_capturers == capturers.size()) {
« no previous file with comments | « no previous file | webrtc/modules/desktop_capture/screen_drawer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698