Bug 1423386 - add logs to debug timeout. draft
authorJW Wang <jwwang@mozilla.com>
Wed, 03 Jan 2018 11:39:24 +0800
changeset 715210 06c0fe6ea08fc66c2177b3dd78e96e4475d0e022
parent 715194 eb3c9895e50cfb31bc0403a9e44af069e2f1f1ec
child 744730 eb2bed22cc251488420e8459de29762cde1ee8da
push id94092
push userjwwang@mozilla.com
push dateWed, 03 Jan 2018 03:40:01 +0000
bugs1423386
milestone59.0a1
Bug 1423386 - add logs to debug timeout. MozReview-Commit-ID: DTdk5m5ojUF
browser/components/originattributes/test/browser/browser_cache.js
--- 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);