| 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/lib/unittest.dart'; | 6 import '../../pkg/unittest/lib/unittest.dart'; |
| 7 import '../../pkg/unittest/lib/html_config.dart'; | 7 import '../../pkg/unittest/lib/html_config.dart'; |
| 8 import 'util.dart'; | 8 import 'util.dart'; |
| 9 import 'dart:html'; | 9 import 'dart:html'; |
| 10 | 10 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 expect(fragment.hidden, isFalse); | 311 expect(fragment.hidden, isFalse); |
| 312 expect(fragment.spellcheck, isFalse); | 312 expect(fragment.spellcheck, isFalse); |
| 313 expect(fragment.translate, isFalse); | 313 expect(fragment.translate, isFalse); |
| 314 expect(fragment.nextElementSibling, isNull); | 314 expect(fragment.nextElementSibling, isNull); |
| 315 expect(fragment.previousElementSibling, isNull); | 315 expect(fragment.previousElementSibling, isNull); |
| 316 expect(fragment.offsetParent, isNull); | 316 expect(fragment.offsetParent, isNull); |
| 317 expect(fragment.parent, isNull); | 317 expect(fragment.parent, isNull); |
| 318 expect(fragment.attributes.isEmpty, isTrue); | 318 expect(fragment.attributes.isEmpty, isTrue); |
| 319 expect(fragment.classes.isEmpty, isTrue); | 319 expect(fragment.classes.isEmpty, isTrue); |
| 320 expect(fragment.dataAttributes.isEmpty, isTrue); | 320 expect(fragment.dataAttributes.isEmpty, isTrue); |
| 321 expect(fragment.matchesSelector("foo"), isFalse); | |
| 322 expect(fragment.matchesSelector("*"), isFalse); | |
| 323 }); | 321 }); |
| 324 | 322 |
| 325 test('style', () { | 323 test('style', () { |
| 326 var fragment = new DocumentFragment(); | 324 var fragment = new DocumentFragment(); |
| 327 var style = fragment.style; | 325 var style = fragment.style; |
| 328 expectEmptyStyleDeclaration(style); | 326 expectEmptyStyleDeclaration(style); |
| 329 fragment.computedStyle.then(expectAsync1((computedStyle) { | 327 fragment.computedStyle.then(expectAsync1((computedStyle) { |
| 330 expectEmptyStyleDeclaration(computedStyle); | 328 expectEmptyStyleDeclaration(computedStyle); |
| 331 })); | 329 })); |
| 332 }); | 330 }); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 344 // // assertConstError(() => fragment.classes.add('foo')); | 342 // // assertConstError(() => fragment.classes.add('foo')); |
| 345 // }); | 343 // }); |
| 346 | 344 |
| 347 test('query searches the fragment', () { | 345 test('query searches the fragment', () { |
| 348 var fragment = new DocumentFragment.html( | 346 var fragment = new DocumentFragment.html( |
| 349 "<div class='foo'><a>foo</a><b>bar</b></div>"); | 347 "<div class='foo'><a>foo</a><b>bar</b></div>"); |
| 350 expect(fragment.query(".foo a").tagName, "A"); | 348 expect(fragment.query(".foo a").tagName, "A"); |
| 351 expect(_nodeStrings(fragment.queryAll(".foo *")), equals(["A", "B"])); | 349 expect(_nodeStrings(fragment.queryAll(".foo *")), equals(["A", "B"])); |
| 352 }); | 350 }); |
| 353 } | 351 } |
| OLD | NEW |