| OLD | NEW |
| 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'); |
| 11 #import('../../../../../ui_lib/util/utilslib.dart'); | 11 #import('../../../../../ui_lib/util/utilslib.dart'); |
| 12 #import('../../../../../../client/testing/unittest/unittest.dart'); | 12 #import('../../../../../../client/testing/unittest/unittest_html.dart'); |
| 13 | 13 |
| 14 #source('GridLayoutDemo.dart'); | 14 #source('GridLayoutDemo.dart'); |
| 15 #source('GridExamples.dart'); | 15 #source('GridExamples.dart'); |
| 16 #source('CSS.dart'); | 16 #source('CSS.dart'); |
| 17 | 17 |
| 18 // TODO(jmesserly): these tests would be easier to work with if they were WebKit | 18 // TODO(jmesserly): these tests would be easier to work with if they were WebKit |
| 19 // layout tests. The way DumpRenderTree works is exactly what we want for | 19 // layout tests. The way DumpRenderTree works is exactly what we want for |
| 20 // testing layout: run the example and then print the element tree with metrics. | 20 // testing layout: run the example and then print the element tree with metrics. |
| 21 // The UnitTestSuite wrapper gets in our way here, because you can't "see" the | 21 // The UnitTestSuite wrapper gets in our way here, because you can't "see" the |
| 22 // test layout visually when you're debugging. | 22 // test layout visually when you're debugging. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 Expect.equals(values[1], offset.top); | 179 Expect.equals(values[1], offset.top); |
| 180 Expect.equals(values[2], offset.width); | 180 Expect.equals(values[2], offset.width); |
| 181 Expect.equals(values[3], offset.height); | 181 Expect.equals(values[3], offset.height); |
| 182 }); | 182 }); |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 | 185 |
| 186 verifyExample(String example, [Map expected = null]) { | 186 verifyExample(String example, [Map expected = null]) { |
| 187 usingGrid(example, (grid) => verifyGrid(example, expected)); | 187 usingGrid(example, (grid) => verifyGrid(example, expected)); |
| 188 } | 188 } |
| OLD | NEW |