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

Side by Side Diff: tests/utils/txt_layout_test.dart

Issue 10683009: Adds support for layout tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 // WebTest=true
6 // WebTestOutput=txt_layout_out.txt
7
8 /**
9 * Tests the layout test functionality of test.dart: using the WebTestOutput
10 * option above we simply compare the final state of this application against a
11 * text file (with a text representation of the DOM tree).
12 */
13 #library("layouttest");
14
15 #import('dart:html');
16
17 main() {
18 var div1Style = _style('blue', 20, 10, 40, 10);
19 var div2Style = _style('red', 25, 30, 40, 10);
20 var div1 = new Element.html('<div style="$div1Style"></div>');
21 var div2 = new Element.html('<div style="$div2Style"></div>');
22 document.body.elements.add(div1);
23 document.body.elements.add(div2);
24 }
25
26 _style(String color, int top, int left, int width, int height) {
27 return ('background-color:$color; position:absolute; '
28 'top:${top}px; left:${left}px; '
29 'width:${width}px; height:${height}px;');
30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698