Bug 1646719 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Reason why the test is time out:

In brief, from the line 1276, when the sixth stream is opened, the cache is full[1],  and all of the cache streams are alive(non-closed) but got suspended. The worst part is that the [`MediaCache::Update()`](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/media/MediaCache.cpp#1224) gets stuck (all of the stream actions(`StreamAction`) are `NONE`). No video is played in the test. 

It's better to find a way to call [`ChannelMediaResource::CacheClientNotifySuspendedStatusChanged`](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/media/ChannelMediaResource.cpp#841) from `MediaCache` so the [`HTMLMediaElement::mDownloadSuspendedByCache`](https://searchfox.org/mozilla-central/rev/dfd9c0f72f9765bd4a187444e0c1e19e8834a506/dom/html/HTMLMediaElement.cpp#5640) can be set and so `HTMLMediaElement` can fire a [`canplaythrough`](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/html/HTMLMediaElement.cpp#6034) event [once the first frame is loaded](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/html/HTMLMediaElement.cpp#5912-5927).


[1] Since the `createImageBitmap-origin.sub.html` use `preload=auto`, so we would [cache as much as data we can](https://searchfox.org/mozilla-central/rev/dfd9c0f72f9765bd4a187444e0c1e19e8834a506/dom/html/HTMLMediaElement.cpp#2947-2949)
The log is created by running `MOZ_LOG="MediaCache:5, nsMediaElement:5" MOZ_LOG_FILE=<FILENAME> ./mach wpt html/canvas/element/manual/imagebitmap/createImageBitmap-origin.sub.html`.

#### The reason why the test is time out:

In brief, from the line 1276, when the sixth stream is opened, the cache is full [1],  and all of the cache streams are alive(non-closed) but got suspended. The worst part is that the [`MediaCache::Update()`](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/media/MediaCache.cpp#1224) gets stuck (all of the stream actions(`StreamAction`) are `NONE`). No video is played in the test. 

It's better to find a way to call [`ChannelMediaResource::CacheClientNotifySuspendedStatusChanged`](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/media/ChannelMediaResource.cpp#841) from `MediaCache` so the [`HTMLMediaElement::mDownloadSuspendedByCache`](https://searchfox.org/mozilla-central/rev/dfd9c0f72f9765bd4a187444e0c1e19e8834a506/dom/html/HTMLMediaElement.cpp#5640) can be set and so `HTMLMediaElement` can fire a [`canplaythrough`](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/html/HTMLMediaElement.cpp#6034) event [once the first frame is loaded](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/html/HTMLMediaElement.cpp#5912-5927).


[1] Since the `createImageBitmap-origin.sub.html` use `preload=auto`, so we would [cache as much as data we can](https://searchfox.org/mozilla-central/rev/dfd9c0f72f9765bd4a187444e0c1e19e8834a506/dom/html/HTMLMediaElement.cpp#2947-2949)
The log is created by running `MOZ_LOG="MediaCache:5, nsMediaElement:5" MOZ_LOG_FILE=<FILENAME> ./mach wpt html/canvas/element/manual/imagebitmap/createImageBitmap-origin.sub.html`.

#### The reason why the test is time out:

In brief, from the line 1276, when the sixth stream is opened, the cache is full [1],  and all of the cache streams are alive(non-closed) but got suspended. The worst part is that the [`MediaCache::Update()`](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/media/MediaCache.cpp#1224) gets stuck (all of the stream actions(`StreamAction`) are `NONE`). No video is played in the test. 

In that case ,it's better to find a way to call [`ChannelMediaResource::CacheClientNotifySuspendedStatusChanged`](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/media/ChannelMediaResource.cpp#841) from `MediaCache` so the [`HTMLMediaElement::mDownloadSuspendedByCache`](https://searchfox.org/mozilla-central/rev/dfd9c0f72f9765bd4a187444e0c1e19e8834a506/dom/html/HTMLMediaElement.cpp#5640) can be set and so `HTMLMediaElement` can fire a [`canplaythrough`](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/html/HTMLMediaElement.cpp#6034) event [once the first frame is loaded](https://searchfox.org/mozilla-central/rev/f21850ca45036ddb84cd25aa355a6969d7c94c4f/dom/html/HTMLMediaElement.cpp#5912-5927).


[1] Since the `createImageBitmap-origin.sub.html` use `preload=auto`, so we would [cache as much as data we can](https://searchfox.org/mozilla-central/rev/dfd9c0f72f9765bd4a187444e0c1e19e8834a506/dom/html/HTMLMediaElement.cpp#2947-2949)

Back to Bug 1646719 Comment 5