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

Side by Side Diff: samples/tests/samples/lib/layout/layout_test.dart

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library('layout_tests'); 5 #library('layout_tests');
6 6
7 #import('dart:html'); 7 #import('dart:html');
8 #import('../../../../ui_lib/base/base.dart'); 8 #import('../../../../ui_lib/base/base.dart');
9 #import('../../../../ui_lib/layout/layout.dart'); 9 #import('../../../../ui_lib/layout/layout.dart');
10 #import('../../../../ui_lib/view/view.dart'); 10 #import('../../../../ui_lib/view/view.dart');
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 window.setTimeout(expectAsync0(() { grid.removeFromDocument(); }), 0); 161 window.setTimeout(expectAsync0(() { grid.removeFromDocument(); }), 0);
162 }, 0); 162 }, 0);
163 } 163 }
164 164
165 verifyGrid(String example, [Map expected = null]) { 165 verifyGrid(String example, [Map expected = null]) {
166 printMetrics(example); 166 printMetrics(example);
167 if (expected == null) { 167 if (expected == null) {
168 return; 168 return;
169 } 169 }
170 170
171 for (String name in expected.getKeys()) { 171 for (String name in expected.keys) {
172 final values = expected[name]; 172 final values = expected[name];
173 final node = document.body.query('#$name'); 173 final node = document.body.query('#$name');
174 Expect.isNotNull(node); 174 Expect.isNotNull(node);
175 node.rect.then(expectAsync0((rect) { 175 node.rect.then(expectAsync0((rect) {
176 final offset = rect.offset; 176 final offset = rect.offset;
177 Expect.equals(values[0], offset.left); 177 Expect.equals(values[0], offset.left);
178 Expect.equals(values[1], offset.top); 178 Expect.equals(values[1], offset.top);
179 Expect.equals(values[2], offset.width); 179 Expect.equals(values[2], offset.width);
180 Expect.equals(values[3], offset.height); 180 Expect.equals(values[3], offset.height);
181 })); 181 }));
182 } 182 }
183 } 183 }
184 184
185 verifyExample(String example, [Map expected = null]) { 185 verifyExample(String example, [Map expected = null]) {
186 usingGrid(example, (grid) => verifyGrid(example, expected)); 186 usingGrid(example, (grid) => verifyGrid(example, expected));
187 } 187 }
OLDNEW
« no previous file with comments | « samples/tests/samples/lib/layout/grid_layout_demo.dart ('k') | samples/ui_lib/layout/GridTracks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698