Bug 1385273 - Convert tests within dom/tests/mochitest/chrome to comply with new data: URI inheritance model. r=smaug
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Tue, 01 Aug 2017 10:59:57 +0200
changeset 423302 c5e543b0dfaaf508c6f57816ee8dc2fb70ab2301
parent 423276 6add1a4978edf718046d4b4ec8c28c09848b57ee
child 423303 bd8bb33f871447a791987df7e12bf03f1611f53b
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1385273
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1385273 - Convert tests within dom/tests/mochitest/chrome to comply with new data: URI inheritance model. r=smaug
dom/tests/mochitest/chrome/chrome.ini
dom/tests/mochitest/chrome/file_clipboard_events_chrome.html
dom/tests/mochitest/chrome/test_clipboard_events_chrome.html
dom/tests/mochitest/chrome/window_focus.xul
dom/tests/mochitest/chrome/window_focus_inner.xul
--- a/dom/tests/mochitest/chrome/chrome.ini
+++ b/dom/tests/mochitest/chrome/chrome.ini
@@ -1,16 +1,17 @@
 [DEFAULT]
 skip-if = os == 'android'
 support-files =
   489127.html
   DOMWindowCreated_chrome.xul
   DOMWindowCreated_content.html
   MozDomFullscreen_chrome.xul
   child_focus_frame.html
+  file_clipboard_events_chrome.html
   file_DOM_element_instanceof.xul
   file_MozDomFullscreen.html
   file_bug799299.xul
   file_bug800817.xul
   file_bug830858.xul
   file_bug1224790-1_modal.xul
   file_bug1224790-1_nonmodal.xul
   file_bug1224790-2_modal.xul
@@ -23,16 +24,17 @@ support-files =
   queryCaretRectWin.html
   selectAtPoint.html
   selectAtPoint-innerframe.html
   sizemode_attribute.xul
   window_activation.xul
   window_callback_wrapping.xul
   window_docshell_swap.xul
   window_focus.xul
+  window_focus_inner.xul
   window_focus_docnav.xul
   !/dom/tests/mochitest/general/file_clonewrapper.html
   !/dom/tests/mochitest/general/file_moving_nodeList.html
   !/dom/tests/mochitest/general/file_moving_xhr.html
   !/dom/tests/mochitest/geolocation/network_geolocation.sjs
 
 [test_DOMWindowCreated.xul]
 [test_DOM_element_instanceof.xul]
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/chrome/file_clipboard_events_chrome.html
@@ -0,0 +1,1 @@
+<body onload='window.opener.doChecks(this)'><input id='i' value='Sample Text'></body>
--- a/dom/tests/mochitest/chrome/test_clipboard_events_chrome.html
+++ b/dom/tests/mochitest/chrome/test_clipboard_events_chrome.html
@@ -8,18 +8,17 @@
 
 <script>
 // This test checks that the dom.event.clipboardevents.enabled does not apply to chrome shells.
 
 SimpleTest.waitForExplicitFinish();
 function runTest()
 {
   SpecialPowers.pushPrefEnv({"set": [['dom.event.clipboardevents.enabled', false]]}, function() {
-    window.open("data:text/html,<body onload='window.opener.doChecks(this)'><input id='i' value='Sample Text'></body>",
-                "_blank", "chrome,width=200,height=200");
+    window.open("file_clipboard_events_chrome.html", "_blank", "chrome,width=200,height=200");
   });
 }
 
 var event_fired = false;
 
 function doChecks(win)
 {
   var windowFocused = function() {
--- a/dom/tests/mochitest/chrome/window_focus.xul
+++ b/dom/tests/mochitest/chrome/window_focus.xul
@@ -1374,25 +1374,18 @@ function switchWindowTest(otherWindow, f
   otherTextbox.addEventListener("focus", textboxFocused, true);
   otherTextbox.focus();
 }
 
 // open a window with no root element
 var noRootWindow = null;
 function doWindowNoRootTest()
 {
-  var data = "data:application/vnd.mozilla.xul+xml," + unescape(
-             "<window onfocus='dostuff()' xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'" +
-             "        style='-moz-user-focus: normal;'>" +
-             "<script>function dostuff() { setTimeout(function() { " +
-             "document.documentElement.focus(); document.removeChild(document.documentElement);" +
-             "window.opener.focus(); }, 100); }</script></window>");
-
   addEventListener("focus", doFrameSwitchingTests, true);
-  noRootWindow = window.open(data, "_blank", "chrome,width=100,height=100");
+  noRootWindow = window.open("window_focus_inner.xul", "_blank", "chrome,width=100,height=100");
 }
 
 // these tests check when focus is moved between a tree of frames to ensure
 // that the focus is in the right place at each event step.
 function doFrameSwitchingTests()
 {
   removeEventListener("focus", doFrameSwitchingTests, true);
   noRootWindow.close();
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/chrome/window_focus_inner.xul
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<window onfocus='dostuff()' xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' style='-moz-user-focus: normal;'>
+<script>
+  function dostuff() {
+    setTimeout(function() {
+      document.documentElement.focus();
+      document.removeChild(document.documentElement);
+      window.opener.focus();
+     }, 100);
+    }
+</script>
+</window>