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

Side by Side Diff: dart/samples/swarm/test/swarm_ui_lib/layout/layout_test.dart

Issue 66253002: Version 0.8.10.9 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 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 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:html'; 9 import 'dart:html';
10 import '../../../swarm_ui_lib/base/base.dart'; 10 import '../../../swarm_ui_lib/base/base.dart';
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 170 }
171 171
172 Future verifyGrid(String example, [Map expected = null]) { 172 Future verifyGrid(String example, [Map expected = null]) {
173 printMetrics(example); 173 printMetrics(example);
174 if (expected == null) { 174 if (expected == null) {
175 return new Future.value(); 175 return new Future.value();
176 } 176 }
177 177
178 for (String name in expected.keys) { 178 for (String name in expected.keys) {
179 final values = expected[name]; 179 final values = expected[name];
180 final node = document.body.query('#$name'); 180 final node = document.body.querySelector('#$name');
181 Expect.isNotNull(node); 181 Expect.isNotNull(node);
182 return new Future.value().then((_) { 182 return new Future.value().then((_) {
183 Expect.equals(values[0], node.offsetLeft); 183 Expect.equals(values[0], node.offsetLeft);
184 Expect.equals(values[1], node.offsetTop); 184 Expect.equals(values[1], node.offsetTop);
185 Expect.equals(values[2], node.offsetWidth); 185 Expect.equals(values[2], node.offsetWidth);
186 Expect.equals(values[3], node.offsetHeight); 186 Expect.equals(values[3], node.offsetHeight);
187 }); 187 });
188 } 188 }
189 } 189 }
190 190
191 Future verifyExample(String example, [Map expected = null]) { 191 Future verifyExample(String example, [Map expected = null]) {
192 return usingGrid(example, (grid) => verifyGrid(example, expected)); 192 return usingGrid(example, (grid) => verifyGrid(example, expected));
193 } 193 }
OLDNEW
« no previous file with comments | « dart/samples/swarm/test/swarm_ui_lib/layout/grid_layout_demo.dart ('k') | dart/samples/third_party/angular_todo/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698