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

Side by Side Diff: LayoutTests/fast/css-grid-layout/resources/grid-definitions-parsing-utils.js

Issue 398013004: [CSS Grid Layout] Small refactoring in grid-auto-flow-get-set.html test (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 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
« no previous file with comments | « LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 function testGridDefinitionsValues(element, columnValue, rowValue, computedColum nValue, computedRowValue) 1 function testGridDefinitionsValues(element, columnValue, rowValue, computedColum nValue, computedRowValue)
2 { 2 {
3 window.element = element; 3 window.element = element;
4 var elementID = element.id || "element"; 4 var elementID = element.id || "element";
5 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro pertyValue('grid-template-columns')", computedColumnValue || columnValue); 5 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro pertyValue('grid-template-columns')", computedColumnValue || columnValue);
6 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro pertyValue('grid-template-rows')", computedRowValue || rowValue); 6 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro pertyValue('grid-template-rows')", computedRowValue || rowValue);
7 } 7 }
8 8
9 function testGridDefinitionsSetJSValues(columnValue, rowValue, computedColumnVal ue, computedRowValue, jsColumnValue, jsRowValue) 9 function testGridDefinitionsSetJSValues(columnValue, rowValue, computedColumnVal ue, computedRowValue, jsColumnValue, jsRowValue)
10 { 10 {
(...skipping 26 matching lines...) Expand all
37 37
38 function testGridDefinitionsSetBadJSValues(columnValue, rowValue) 38 function testGridDefinitionsSetBadJSValues(columnValue, rowValue)
39 { 39 {
40 window.element = document.createElement("div"); 40 window.element = document.createElement("div");
41 document.body.appendChild(element); 41 document.body.appendChild(element);
42 element.style.gridTemplateColumns = columnValue; 42 element.style.gridTemplateColumns = columnValue;
43 element.style.gridTemplateRows = rowValue; 43 element.style.gridTemplateRows = rowValue;
44 // We can't use testSetJSValues as element.style.gridTemplateRows returns "" . 44 // We can't use testSetJSValues as element.style.gridTemplateRows returns "" .
45 testGridDefinitionsValues(element, "none", "none"); 45 testGridDefinitionsValues(element, "none", "none");
46 document.body.removeChild(element); 46 document.body.removeChild(element);
47 } 47 }
48
49 function checkGridAutoFlowSetCSSValue(elementId, expectedValue)
50 {
51 shouldBe("window.getComputedStyle(" + elementId + ", '').getPropertyValue('g rid-auto-flow')", "'" + expectedValue + "'");
52 }
53
54 function checkGridAutoFlowSetJSValue(newValue, expectedStyleValue, expectedCompu tedStyleValue)
55 {
56 element = document.createElement("div");
57 document.body.appendChild(element);
58 if (newValue)
59 element.style.gridAutoFlow = newValue;
60 shouldBe("element.style.gridAutoFlow", "'" + expectedStyleValue + "'");
61 shouldBe("window.getComputedStyle(element, '').getPropertyValue('grid-auto-f low')", "'" + expectedComputedStyleValue + "'");
62 document.body.removeChild(element);
63 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698