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('DocumentFragmentTest'); | 5 #library('DocumentFragmentTest'); |
6 #import('../../pkg/unittest/unittest.dart'); | 6 #import('../../pkg/unittest/unittest.dart'); |
7 #import('../../pkg/unittest/html_config.dart'); | 7 #import('../../pkg/unittest/html_config.dart'); |
8 #import('dart:html'); | 8 #import('dart:html'); |
9 #source('util.dart'); | 9 #source('util.dart'); |
10 | 10 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 fragment.focus(); | 286 fragment.focus(); |
287 fragment.click(); | 287 fragment.click(); |
288 fragment.scrollByLines(2); | 288 fragment.scrollByLines(2); |
289 fragment.scrollByPages(2); | 289 fragment.scrollByPages(2); |
290 fragment.scrollIntoView(); | 290 fragment.scrollIntoView(); |
291 fragment.webkitRequestFullScreen(2); | 291 fragment.webkitRequestFullScreen(2); |
292 }); | 292 }); |
293 | 293 |
294 test('default values', () { | 294 test('default values', () { |
295 var fragment = new DocumentFragment(); | 295 var fragment = new DocumentFragment(); |
296 fragment.rect.then(expectAsync1((ElementRect rect) { | |
297 expectEmptyRect(rect.client); | |
298 expectEmptyRect(rect.offset); | |
299 expectEmptyRect(rect.scroll); | |
300 expectEmptyRect(rect.bounding); | |
301 Expect.isTrue(rect.clientRects.isEmpty); | |
302 })); | |
303 Expect.equals("false", fragment.contentEditable); | 296 Expect.equals("false", fragment.contentEditable); |
304 Expect.equals(-1, fragment.tabIndex); | 297 Expect.equals(-1, fragment.tabIndex); |
305 Expect.equals("", fragment.id); | 298 Expect.equals("", fragment.id); |
306 Expect.equals("", fragment.title); | 299 Expect.equals("", fragment.title); |
307 Expect.equals("", fragment.tagName); | 300 Expect.equals("", fragment.tagName); |
308 Expect.equals("", fragment.webkitdropzone); | 301 Expect.equals("", fragment.webkitdropzone); |
309 Expect.equals("", fragment.webkitRegionOverflow); | 302 Expect.equals("", fragment.webkitRegionOverflow); |
310 Expect.isFalse(fragment.isContentEditable); | 303 Expect.isFalse(fragment.isContentEditable); |
311 Expect.isFalse(fragment.draggable); | 304 Expect.isFalse(fragment.draggable); |
312 Expect.isFalse(fragment.hidden); | 305 Expect.isFalse(fragment.hidden); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 // // assertConstError(() => fragment.classes.add('foo')); | 338 // // assertConstError(() => fragment.classes.add('foo')); |
346 // }); | 339 // }); |
347 | 340 |
348 test('query searches the fragment', () { | 341 test('query searches the fragment', () { |
349 var fragment = new DocumentFragment.html( | 342 var fragment = new DocumentFragment.html( |
350 "<div class='foo'><a>foo</a><b>bar</b></div>"); | 343 "<div class='foo'><a>foo</a><b>bar</b></div>"); |
351 Expect.equals("A", fragment.query(".foo a").tagName); | 344 Expect.equals("A", fragment.query(".foo a").tagName); |
352 Expect.listEquals(["A", "B"], _nodeStrings(fragment.queryAll(".foo *"))); | 345 Expect.listEquals(["A", "B"], _nodeStrings(fragment.queryAll(".foo *"))); |
353 }); | 346 }); |
354 } | 347 } |
OLD | NEW |