Bug 1321198 - this is a debugging patch which crashes when test_seek* time out to get the stack trace about what's stuck. r?jya
MozReview-Commit-ID: L7Q3Fyapkzf
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -3669,30 +3669,35 @@ uint32_t MediaDecoderStateMachine::GetAm
: std::max<uint32_t>(sVideoQueueDefaultSize, MIN_VIDEO_QUEUE_SIZE);
}
void
MediaDecoderStateMachine::DumpDebugInfo()
{
MOZ_ASSERT(NS_IsMainThread());
+ bool crash = Preferences::GetBool("media.test.crashOnDumpDebugInfo", false);
+
// It is fine to capture a raw pointer here because MediaDecoder only call
// this function before shutdown begins.
- nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([this] () {
+ nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([this, crash] () {
mMediaSink->DumpDebugInfo();
mStateObj->DumpDebugInfo();
DUMP_LOG(
"GetMediaTime=%lld GetClock=%lld mMediaSink=%p "
"mState=%s mPlayState=%d mSentFirstFrameLoadedEvent=%d IsPlaying=%d "
"mAudioStatus=%s mVideoStatus=%s mDecodedAudioEndTime=%lld mDecodedVideoEndTime=%lld "
"mAudioCompleted=%d mVideoCompleted=%d",
GetMediaTime(), mMediaSink->IsStarted() ? GetClock() : -1, mMediaSink.get(),
ToStateStr(), mPlayState.Ref(), mSentFirstFrameLoadedEvent, IsPlaying(),
AudioRequestStatus(), VideoRequestStatus(), mDecodedAudioEndTime, mDecodedVideoEndTime,
mAudioCompleted, mVideoCompleted);
+ if (crash) {
+ MOZ_CRASH();
+ }
});
// Since the task is run asynchronously, it is possible other tasks get first
// and change the object states before we print them. Therefore we want to
// dispatch this task immediately without waiting for the tail dispatching
// phase so object states are less likely to change before being printed.
OwnerThread()->Dispatch(r.forget(),
AbstractThread::AssertDispatchSuccess, AbstractThread::TailDispatch);
--- a/dom/media/test/seek_support.js
+++ b/dom/media/test/seek_support.js
@@ -1,10 +1,12 @@
var manager = new MediaTestManager;
+gTestPrefs = gTestPrefs.concat([['media.test.crashOnDumpDebugInfo', true]]);
+
function createTestArray() {
var tests = [];
var tmpVid = document.createElement("video");
for (var testNum=0; testNum<gSeekTests.length; testNum++) {
var test = gSeekTests[testNum];
if (!tmpVid.canPlayType(test.type)) {
continue;