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

Side by Side Diff: sky/tests/layout/custom.sky

Issue 1060013005: Make changing your layout manager work. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « sky/engine/core/dom/Element.cpp ('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 <root style="width: 300px"> 1 <root style="width: 300px">
2 <parent style='background-color: lightblue;'> 2 <parent style='background-color: lightblue;'>
3 <child style='background-color: pink;'> 3 <child style='background-color: pink;'>
4 <grandchild style='background-color: red; width: 25px; height: 25px;'></gr andchild> 4 <grandchild style='background-color: red; width: 25px; height: 25px;'></gr andchild>
5 </child> 5 </child>
6 <child2 style='background-color: salmon; height: 25px;' /> 6 <child2 style='background-color: salmon; height: 25px;' />
7 </parent> 7 </parent>
8 </root> 8 </root>
9 9
10 <script> 10 <script>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 assertNonChangingValues(); 77 assertNonChangingValues();
78 78
79 first = false; 79 first = false;
80 parent.setNeedsLayout(); 80 parent.setNeedsLayout();
81 81
82 window.requestAnimationFrame((_) { 82 window.requestAnimationFrame((_) {
83 expect(parent.offsetWidth, equals(150)); 83 expect(parent.offsetWidth, equals(150));
84 expect(secondChild.offsetWidth, equals(150)); 84 expect(secondChild.offsetWidth, equals(150));
85 assertNonChangingValues(); 85 assertNonChangingValues();
86 86
87 parent.setLayoutManager(null); 87 parent.setLayoutManager(() {
88 parent.width = 250.0;
89 });
88 90
89 window.requestAnimationFrame((_) { 91 window.requestAnimationFrame((_) {
90 expect(parent.offsetWidth, equals(300)); 92 expect(parent.offsetWidth, equals(250));
91 expect(parent.offsetHeight, equals(50)); 93 assertNonChangingValues();
92 expect(parent.offsetTop, equals(0));
93 expect(parent.offsetLeft, equals(0));
94 94
95 expect(firstChild.offsetWidth, equals(300)); 95 parent.setLayoutManager(null);
96 expect(firstChild.offsetHeight, equals(25));
97 expect(firstChild.offsetTop, equals(0));
98 expect(firstChild.offsetLeft, equals(0));
99 96
100 expect(secondChild.offsetWidth, equals(300)); 97 window.requestAnimationFrame((_) {
101 expect(secondChild.offsetHeight, equals(25)); 98 expect(parent.offsetWidth, equals(300));
102 expect(secondChild.offsetTop, equals(25)); 99 expect(parent.offsetHeight, equals(50));
103 expect(secondChild.offsetLeft, equals(0)); 100 expect(parent.offsetTop, equals(0));
101 expect(parent.offsetLeft, equals(0));
104 102
105 expect(grandChild.offsetWidth, equals(25)); 103 expect(firstChild.offsetWidth, equals(300));
106 expect(grandChild.offsetHeight, equals(25)); 104 expect(firstChild.offsetHeight, equals(25));
107 expect(grandChild.offsetTop, equals(0)); 105 expect(firstChild.offsetTop, equals(0));
108 expect(grandChild.offsetLeft, equals(0)); 106 expect(firstChild.offsetLeft, equals(0));
109 107
110 completer.complete(); 108 expect(secondChild.offsetWidth, equals(300));
109 expect(secondChild.offsetHeight, equals(25));
110 expect(secondChild.offsetTop, equals(25));
111 expect(secondChild.offsetLeft, equals(0));
112
113 expect(grandChild.offsetWidth, equals(25));
114 expect(grandChild.offsetHeight, equals(25));
115 expect(grandChild.offsetTop, equals(0));
116 expect(grandChild.offsetLeft, equals(0));
117
118 completer.complete();
119 });
111 }); 120 });
112 }); 121 });
113 }); 122 });
114 123
115 return completer.future; 124 return completer.future;
116 }); 125 });
117 } 126 }
118 </script> 127 </script>
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698