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

Side by Side Diff: tests/html/element_test.dart

Issue 12091006: Fixing element_test on Safari. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adding a delay for setTimeout as well. Created 7 years, 11 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
« no previous file with comments | « no previous file | tests/html/microtask_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ElementTest; 5 library ElementTest;
6 import '../../pkg/unittest/lib/unittest.dart'; 6 import '../../pkg/unittest/lib/unittest.dart';
7 import '../../pkg/unittest/lib/html_individual_config.dart'; 7 import '../../pkg/unittest/lib/html_individual_config.dart';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:svg' as svg; 9 import 'dart:svg' as svg;
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 var isElementIterable = 62 var isElementIterable =
63 predicate((x) => x is Iterable<Element>, 'is an Iterable<Element>'); 63 predicate((x) => x is Iterable<Element>, 'is an Iterable<Element>');
64 var isHeadingElement = 64 var isHeadingElement =
65 predicate((x) => x is HeadingElement, 'is a HeadingElement'); 65 predicate((x) => x is HeadingElement, 'is a HeadingElement');
66 66
67 Element makeElement() => new Element.tag('div'); 67 Element makeElement() => new Element.tag('div');
68 68
69 Element makeElementWithChildren() => 69 Element makeElementWithChildren() =>
70 new Element.html("<div><br/><img/><input/></div>"); 70 new Element.html("<div><br/><img/><input/></div>");
71 71
72 test('computedStyle', () { 72 group('position', () {
73 final element = document.body; 73 test('computedStyle', () {
74 element.computedStyle.then(expectAsync1((style) { 74 final element = document.body;
75 var style = element.getComputedStyle();
75 expect(style.getPropertyValue('left'), 'auto'); 76 expect(style.getPropertyValue('left'), 'auto');
76 })); 77 });
77 });
78 78
79 test('client position synchronous', () { 79 test('client position synchronous', () {
80 final container = new Element.tag("div"); 80 final container = new Element.tag("div");
81 container.style.position = 'absolute'; 81 container.style.position = 'absolute';
82 container.style.top = '8px'; 82 container.style.top = '8px';
83 container.style.left = '8px'; 83 container.style.left = '8px';
84 final element = new Element.tag("div"); 84 final element = new Element.tag("div");
85 element.style.width = '200px'; 85 element.style.width = '200px';
86 element.style.height = '200px'; 86 element.style.height = '200px';
87 container.children.add(element); 87 container.children.add(element);
88 document.body.children.add(container); 88 document.body.children.add(container);
89 89
90 expect(element.clientWidth, greaterThan(100)); 90 expect(element.clientWidth, greaterThan(100));
91 expect(element.clientHeight, greaterThan(100)); 91 expect(element.clientHeight, greaterThan(100));
92 expect(element.offsetWidth, greaterThan(100)); 92 expect(element.offsetWidth, greaterThan(100));
93 expect(element.offsetHeight, greaterThan(100)); 93 expect(element.offsetHeight, greaterThan(100));
94 expect(element.scrollWidth, greaterThan(100)); 94 expect(element.scrollWidth, greaterThan(100));
95 expect(element.scrollHeight, greaterThan(100)); 95 expect(element.scrollHeight, greaterThan(100));
96 expect(element.getBoundingClientRect().left, 8); 96 expect(element.getBoundingClientRect().left, 8);
97 expect(element.getBoundingClientRect().top, 8); 97 expect(element.getBoundingClientRect().top, 8);
98 container.remove(); 98 container.remove();
99 });
99 }); 100 });
100 101
101 group('constructors', () { 102 group('constructors', () {
102 test('error', () { 103 test('error', () {
103 expect(() => new Element.html('<br/><br/>'), throwsArgumentError); 104 expect(() => new Element.html('<br/><br/>'), throwsArgumentError);
104 }); 105 });
105 106
106 test('.html has no parent', () => 107 test('.html has no parent', () =>
107 expect(new Element.html('<br/>').parent, isNull)); 108 expect(new Element.html('<br/>').parent, isNull));
108 109
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 }); 735 });
735 736
736 test('getRange', () { 737 test('getRange', () {
737 var range = makeElList().getRange(1, 2); 738 var range = makeElList().getRange(1, 2);
738 expect(range, isElementList); 739 expect(range, isElementList);
739 expect(range[0], isImageElement); 740 expect(range[0], isImageElement);
740 expect(range[1], isInputElement); 741 expect(range[1], isInputElement);
741 }); 742 });
742 }); 743 });
743 } 744 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/microtask_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698