Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1073)

Side by Side Diff: third_party/WebKit/LayoutTests/css3/flexbox/display-flexbox-set-get.html

Issue 2130543003: Convert some flexbox tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <link href="resources/flexbox.css" rel="stylesheet"> 4 <link href="resources/flexbox.css" rel="stylesheet">
5 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
6 </head> 7 </head>
7 <body> 8 <body>
9 <p>Test that setting and getting display: flex and inline-flex works as expected </p>
10 <div id="log"></div>
8 <div class="flexbox" id="flexbox"></div> 11 <div class="flexbox" id="flexbox"></div>
9 <div class="inline-flexbox" id="flexboxInline"></div> 12 <div class="inline-flexbox" id="flexboxInline"></div>
10 <script> 13 <script>
11 description('Test that setting and getting display: flex and inline-flex works a s expected');
12 14
13 debug("Test getting |display| set through CSS"); 15 test(function() {
14 var flexboxElement = document.getElementById("flexbox"); 16 var flexboxElement = document.getElementById("flexbox");
15 shouldBe("getComputedStyle(flexboxElement, '').getPropertyValue('display')", "'f lex'"); 17 assert_equals(getComputedStyle(flexboxElement, '').getPropertyValue('display'), 'flex');
16 var inlineFlexboxElement = document.getElementById("flexboxInline"); 18 var inlineFlexboxElement = document.getElementById("flexboxInline");
17 shouldBe("getComputedStyle(inlineFlexboxElement, '').getPropertyValue('display') ", "'inline-flex'"); 19 assert_equals(getComputedStyle(inlineFlexboxElement, '').getPropertyValue('displ ay'), 'inline-flex');
20 }, "Test getting |display| set through CSS");
18 21
19 debug(""); 22 test(function() {
20 debug("Test getting and setting display through JS");
21 var element = document.createElement("div"); 23 var element = document.createElement("div");
22 document.body.appendChild(element); 24 document.body.appendChild(element);
23 shouldBe("getComputedStyle(element, '').getPropertyValue('display')", "'block'") ; 25 assert_equals(getComputedStyle(element, '').getPropertyValue('display'), 'block' );
24 element.style.display = "flex"; 26 element.style.display = "flex";
25 shouldBe("getComputedStyle(element, '').getPropertyValue('display')", "'flex'"); 27 assert_equals(getComputedStyle(element, '').getPropertyValue('display'), 'flex') ;
26 28
27 element = document.createElement("div"); 29 element = document.createElement("div");
28 document.body.appendChild(element); 30 document.body.appendChild(element);
29 shouldBe("getComputedStyle(element, '').getPropertyValue('display')", "'block'") ; 31 assert_equals(getComputedStyle(element, '').getPropertyValue('display'), 'block' );
30 element.style.display = "inline-flex"; 32 element.style.display = "inline-flex";
31 shouldBe("getComputedStyle(element, '').getPropertyValue('display')", "'inline-f lex'"); 33 assert_equals(getComputedStyle(element, '').getPropertyValue('display'), 'inline -flex');
32 element.style.display = "-webkit-flex"; 34 element.style.display = "-webkit-flex";
33 shouldBe("getComputedStyle(element, '').getPropertyValue('display')", "'flex'"); 35 assert_equals(getComputedStyle(element, '').getPropertyValue('display'), 'flex') ;
34 element.style.display = "-webkit-inline-flex"; 36 element.style.display = "-webkit-inline-flex";
35 shouldBe("getComputedStyle(element, '').getPropertyValue('display')", "'inline-f lex'"); 37 assert_equals(getComputedStyle(element, '').getPropertyValue('display'), 'inline -flex');
38
39 }, "Test getting and setting display through JS");
36 </script> 40 </script>
37 </body> 41 </body>
38 </html> 42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698