Bug 1423386 - add logs to debug timeout.
MozReview-Commit-ID: DTdk5m5ojUF
--- a/browser/components/originattributes/test/browser/browser_cache.js
+++ b/browser/components/originattributes/test/browser/browser_cache.js
@@ -156,33 +156,37 @@ async function doTest(aBrowser) {
let audioTrack = content.document.createElement("track");
// Append the audio and track element into the body, and wait until they're finished.
await new Promise(resolve => {
let audioLoaded = false;
let trackLoaded = false;
let audioListener = () => {
+ info(`Audio suspended: ${audioURL + URLSuffix}`);
audio.removeEventListener("suspend", audioListener);
audioLoaded = true;
if (audioLoaded && trackLoaded) {
resolve();
}
};
let trackListener = () => {
+ info(`Audio track loaded: ${audioURL + URLSuffix}`);
audioTrack.removeEventListener("load", trackListener);
trackLoaded = true;
if (audioLoaded && trackLoaded) {
resolve();
}
};
+ info(`Loading audio: ${audioURL + URLSuffix}`);
+
// Add the event listeners before everything in case we lose events.
audioTrack.addEventListener("load", trackListener);
audio.addEventListener("suspend", audioListener);
// Assign attributes for the audio element.
audioSource.setAttribute("src", audioURL + URLSuffix);
audioSource.setAttribute("type", "audio/ogg");
audioTrack.setAttribute("src", trackURL);
@@ -193,20 +197,23 @@ async function doTest(aBrowser) {
audio.autoplay = true;
content.document.body.appendChild(audio);
});
// Append the video element into the body, and wait until it's finished.
await new Promise(resolve => {
let listener = () => {
+ info(`Video suspended: ${videoURL + URLSuffix}`);
video.removeEventListener("suspend", listener);
resolve();
};
+ info(`Loading video: ${videoURL + URLSuffix}`);
+
// Add the event listener before everything in case we lose the event.
video.addEventListener("suspend", listener);
// Assign attributes for the video element.
video.setAttribute("src", videoURL + URLSuffix);
video.setAttribute("type", "video/ogg");
content.document.body.appendChild(video);