Bug 1191597 part 6 - Remove windowed plugins before closing to work around bug 1237853. draft
authorXidorn Quan <quanxunzhen@gmail.com>
Fri, 08 Jan 2016 12:15:16 +1100
changeset 319977 94024145bf99b601e198cd8ff216a8933bf36bc7
parent 319976 c20311140df7b37c78983acb9cd8b68a4f8c1053
child 319978 2e04bfe0193018c247bc28b355c42fde287f19e2
push id9116
push userxquan@mozilla.com
push dateFri, 08 Jan 2016 09:53:58 +0000
bugs1191597, 1237853
milestone46.0a1
Bug 1191597 part 6 - Remove windowed plugins before closing to work around bug 1237853.
dom/html/test/file_fullscreen-plugins.html
--- a/dom/html/test/file_fullscreen-plugins.html
+++ b/dom/html/test/file_fullscreen-plugins.html
@@ -56,16 +56,20 @@ function ok(condition, msg) {
 function is(a, b, msg) {
   opener.is(a, b, "[plugins] " + msg);
 }
 
 function e(id) {
   return document.getElementById(id);
 }
 
+function removeElement(e) {
+  e.parentNode.removeChild(e);
+}
+
 const isMacOs = navigator.appVersion.indexOf("Macintosh") != -1;
 
 var windowedPlugin = null;
 
 function begin() {
   // Delay test startup long enough for the windowed plugin in the subframe to
   // start up and create its window.
   opener.SimpleTest.executeSoon(function() {
@@ -106,16 +110,20 @@ function nonMacTest2() {
   ok(document.mozFullScreen, "Request for full-screen with non-plugin focused should be granted.");
   // Focus a windowed plugin, full-screen should be revoked.
   addFullscreenChangeContinuation("exit", nonMacTest3);
   e("windowed-plugin").focus();
 }
 
 function nonMacTest3() {
   ok(!document.mozFullScreen, "Full-screen should have been revoked when windowed-plugin was focused.");
+  // Remove windowed plugins before closing the window
+  // to work around bug 1237853.
+  removeElement(e("windowed-plugin"));
+  removeElement(e("subdoc-plugin").contentDocument.getElementById("windowed-plugin"));
   opener.nextTest();
 }
 
 var fullScreenChangeCount = 0;
 
 function createWindowedPlugin() {
   var p = document.createElement("embed");
   p.setAttribute("type", "application/x-test");