Bug 1110277 patch 8 - Add test for passing lazy construction parameters through, using flexbox reframe case. r=bzbarsky

This tests a case that is fixed by patch 6.  In particular, I tested that:
 * with none of the patches in the bug applied, the two added tests
   fail, both reporting rgb(255, 255, 0)
 * with all patches 1-7 applied, the two added tests pass
 * with only patches 4-6 applied, the two added tests pass
 * with only patches 4-5 applied, the two added tests fail, both
   reporting rgb(255, 255, 0)

Note that this test is structured in a rather particular way (with two
separate restyles triggered by attributes on different elements, queued
in a particular order) to avoid triggering bug 1111451.  (Though I ended
up fixing that anyway in the revision of these patches, so it's probably
doesn't require as particular a structure anymore.  FIXME: In fact, I
should probably add some additional tests.)
This commit is contained in:
L. David Baron 2015-01-13 21:03:13 -08:00
Родитель c90d6e2a33
Коммит e5ab574deb
1 изменённых файлов: 30 добавлений и 0 удалений

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

@ -39,6 +39,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=625289
#fline::first-line { color: yellow }
#fline.narrow { width: 50px }
#fline i { transition: color linear 1s }
#flexboxtest #flex { display: flex; flex-direction: column }
#flexboxtest #flextransition { color: blue; transition: color 5s linear }
#flexboxtest #flexkid[newstyle] { resize: both }
#flexboxtest #flextransition[newstyle] { color: yellow }
</style>
</head>
<body>
@ -47,6 +53,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=625289
<div id="fline">
This text has an <i>i element</i> in it.
</div>
<div id="flexboxtest">
<div id="flex">
hello
<span id="flexkid">this appears</span>
hello
<div id="flextransition">color transition</div>
</div>
</div>
<pre id="test">
<script>
"use strict";
@ -260,6 +274,22 @@ for (var firstline_test_idx in firstline_tests) {
do_firstline_test(firstline_tests[firstline_test_idx]);
}
function do_flexbox_reframe_test()
{
var flextransition = document.getElementById("flextransition");
var cs = getComputedStyle(flextransition, "");
cs.backgroundColor;
flextransition.setAttribute("newstyle", "");
document.getElementById("flexkid").setAttribute("newstyle", "");
is(cs.color, "rgb(0, 0, 255)",
"color at start of wrapped flexbox transition");
advance_clock(1000);
is(cs.color, "rgb(51, 51, 204)",
"color one second in to wrapped flexbox transition");
}
do_flexbox_reframe_test();
SpecialPowers.DOMWindowUtils.restoreNormalRefresh();
</script>