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

Unified Diff: client/tests/client/html/ElementTests.dart

Issue 9148015: Example showing alternate async measurement solution (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final version Created 8 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 side-by-side diff with in-line comments
Download patch
Index: client/tests/client/html/ElementTests.dart
diff --git a/client/tests/client/html/ElementTests.dart b/client/tests/client/html/ElementTests.dart
index 050e4437e8d408ae79271746c69aa030d2baf5be..9a7743ad757cff3a71e3cb9126222b433f04c792 100644
--- a/client/tests/client/html/ElementTests.dart
+++ b/client/tests/client/html/ElementTests.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -48,9 +48,8 @@ Element makeElementWithChildren() =>
void testElement() {
asyncTest('computedStyle', 1, () {
- final element = document.body;
- element.computedStyle.then((style) {
- Expect.equals(style.getPropertyValue('left'), 'auto');
+ window.requestMeasurementFrame(() {
+ Expect.equals(document.body.computedStyle.left, 'auto');
callbackDone();
});
});
@@ -66,7 +65,8 @@ void testElement() {
container.elements.add(element);
document.body.elements.add(container);
- element.rect.then((rect) {
+ window.requestMeasurementFrame(() {
+ final rect = element.rect;
expectLargeRect(rect.client);
expectLargeRect(rect.offset);
expectLargeRect(rect.scroll);
@@ -266,7 +266,7 @@ void testElement() {
});
test('eventListeners', () {
- final element = new Element.tag('div');
+ ElementWrappingImplementation element = new Element.tag('div');
final on = element.on;
final rawElement = unwrapDomObject(element);

Powered by Google App Engine
This is Rietveld 408576698