Bug 1274879 - Terminate event listeners of videocontrols in destructor. r=jaws

MozReview-Commit-ID: CXXGXIsheAN

--HG--
extra : source : b7cc015fb9030af239af653e4dff15c1a6c6e476
This commit is contained in:
Xidorn Quan 2016-06-14 11:38:21 +01:00
Родитель 6d87e39b07
Коммит 70613457d1
2 изменённых файлов: 22 добавлений и 0 удалений

Просмотреть файл

@ -74,6 +74,15 @@ function isVolumeSliderShowingCorrectVolume(expectedVolume) {
"volume slider should match expected volume");
}
function forceReframe() {
// Setting display then getting the bounding rect to force a frame
// reconstruction on the video element.
video.style.display = "block";
video.getBoundingClientRect();
video.style.display = "";
video.getBoundingClientRect();
}
function runTest(event) {
ok(true, "----- test #" + testnum + " -----");
@ -343,6 +352,17 @@ function runTest(event) {
case 25:
is(event.type, "mozfullscreenchange", "checking event type");
is(video.volume, 0.6, "Volume should still be 0.6");
SimpleTest.executeSoon(function() {
isVolumeSliderShowingCorrectVolume(video.volume);
forceReframe();
video.focus();
synthesizeKey("VK_DOWN", {});
});
break;
case 26:
is(event.type, "volumechange", "checking event type");
is(video.volume, 0.5, "Volume should be decreased by 0.1");
SimpleTest.executeSoon(function() {
isVolumeSliderShowingCorrectVolume(video.volume);
SimpleTest.finish();

Просмотреть файл

@ -1377,6 +1377,7 @@
</constructor>
<destructor>
<![CDATA[
this.Utils.terminateEventListeners();
// randomID used to be a <field>, which meant that the XBL machinery
// undefined the property when the element was unbound. The code in
// this file actually depends on this, so now that randomID is an
@ -1765,6 +1766,7 @@
</constructor>
<destructor>
<![CDATA[
this.Utils.terminateEventListeners();
// randomID used to be a <field>, which meant that the XBL machinery
// undefined the property when the element was unbound. The code in
// this file actually depends on this, so now that randomID is an