Bug 984711 part 8: Remove pref-setting mochitest wrapper for min-[size]:auto mochitest. (no review; tweaking existing test)
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 22 Jul 2014 08:24:35 -0700
changeset 195508 dc309b3a6da74f1501f8317f6415db576b5dfec3
parent 195507 d8697fee9328f6e81b507234640af7bbb307e52e
child 195509 106c96d0abd10936e41b588df9da8ab0230dee81
push id27184
push userkwierso@gmail.com
push dateWed, 23 Jul 2014 00:39:18 +0000
treeherdermozilla-central@0ad20ad7b70a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs984711
milestone34.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 984711 part 8: Remove pref-setting mochitest wrapper for min-[size]:auto mochitest. (no review; tweaking existing test)
layout/style/test/file_flexbox_min_size_auto.html
layout/style/test/mochitest.ini
layout/style/test/test_flexbox_min_size_auto.html
--- a/layout/style/test/file_flexbox_min_size_auto.html
+++ b/layout/style/test/file_flexbox_min_size_auto.html
@@ -1,14 +1,22 @@
 <!DOCTYPE HTML>
 <html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=763689
+-->
 <head>
   <meta charset="utf-8">
+  <title>Test behavior of 'min-height:auto' and 'min-width:auto' (Bug 763689)</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=763689">Mozilla Bug 763689</a>
+<body>
 <div id="display">
   <div id="non-flex-item">abc</div>
   <div style="display: flex">
     <div id="horizontal-flex-item">abc</div>
   </div>
   <div style="display: flex; flex-direction: column">
     <div id="vertical-flex-item">abc</div>
   </div>
@@ -47,21 +55,16 @@
  * NOTE: As of this test's writing, we don't yet support enumerated keyword
  * values (including "min-content") for the "min-height" property. So for
  * now, "min-height: auto" always produces "0" in getComputedStyle, even on
  * a vertical flex item. (Though internally, we do know that it's really
  * "auto", and our flex container will correctly use the flex item's
  * min-content height as needed in layout.)
  */
 
-// Use "is()", "ok()", and "todo_is()" from parent document.
-var is = parent.is;
-var ok = parent.ok;
-var todo_is = parent.todo_is;
-
 // Given an element ID, this function sets the corresponding
 // element's inline-style min-width and min-height explicitly to "auto".
 function setElemMinSizesToAuto(aElemId) {
   var elem = document.getElementById(aElemId);
 
   is(elem.style.minWidth, "", "min-width should be initially unset");
   elem.style.minWidth = "auto";
   is(elem.style.minWidth, "auto", "min-width should accept 'auto' value");
@@ -114,33 +117,28 @@ function checkAllTheMinSizes() {
   // computes to "min-content" (except for now, it computes to "0px", because
   // we don't support "min-content" on heights yet.  We pass "-moz-min-content"
   // as the final arg, to get it checked as the "todo" min-height.)
   checkElemMinSizes("vertical-flex-item", "0px", "0px", "-moz-min-content");
 }
 
 // Main test function
 function main() {
-  ok(SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
-     "expecting to be run with flexbox support enabled");
-
   // First: check that min-sizes are what we expect, with min-size properties
   // at their initial value.
   checkAllTheMinSizes();
 
   // Now, we *explicitly* set min-size properties to "auto"...
   var elemIds = [ "non-flex-item",
                   "horizontal-flex-item",
                   "vertical-flex-item"];
   elemIds.forEach(setElemMinSizesToAuto);
 
   // ...and try again (should have the same result):
   checkAllTheMinSizes();
-
-  parent.finish();
 }
 
 main();
 
 </script>
 </pre>
 </body>
 </html>
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -123,18 +123,17 @@ skip-if = toolkit == 'android' #bug 5366
 [test_dont_use_document_colors.html]
 [test_extra_inherit_initial.html]
 [test_flexbox_align_self_auto.html]
 [test_flexbox_child_display_values.xhtml]
 [test_flexbox_flex_grow_and_shrink.html]
 [test_flexbox_flex_shorthand.html]
 [test_flexbox_layout.html]
 support-files = flexbox_layout_testcases.js
-[test_flexbox_min_size_auto.html]
-support-files = file_flexbox_min_size_auto.html
+# [test_flexbox_min_size_auto.html] # (will uncomment in next patch)
 [test_flexbox_order.html]
 [test_flexbox_order_table.html]
 [test_font_face_parser.html]
 [test_font_family_parsing.html]
 [test_font_feature_values_parsing.html]
 [test_garbage_at_end_of_declarations.html]
 [test_grid_item_shorthands.html]
 [test_grid_container_shorthands.html]
deleted file mode 100644
--- a/layout/style/test/test_flexbox_min_size_auto.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=763689
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test behavior of 'min-height:auto' and 'min-width:auto' (Bug 763689)</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=763689">Mozilla Bug 763689</a>
-<div id="display">
-  <iframe id="iframe"></iframe>
-</div>
-<pre id="test">
-<script type="application/javascript">
-"use strict";
-
-/** Test 'min-height:auto' and 'min-width:auto' (Bug 763689) **/
-
-/*
- * This mochitest runs in an iframe so that we can selectively turn on the
- * flexbox about:config pref before its document is instantiated.
- *
- * See the iframe's source ("file_flexbox_min_size_auto.html") for the actual
- * test code and for more documentation.
- */
-
-SimpleTest.waitForExplicitFinish();
-
-SpecialPowers.setBoolPref("layout.css.flexbox.enabled", true);
-document.getElementById("iframe").src = "file_flexbox_min_size_auto.html";
-
-function finish() {
-  SpecialPowers.clearUserPref("layout.css.flexbox.enabled");
-  SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>