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

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

Issue 11419300: Dartifying dart:html type names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Unminifying & fixing Stephen's feedback. Created 8 years 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 | « tests/html/cssstyledeclaration_test.dart ('k') | tests/html/domparser_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 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 'dart:html'; 8 import 'dart:html';
9 part 'util.dart'; 9 part 'util.dart';
10 10
(...skipping 20 matching lines...) Expand all
31 try { 31 try {
32 fn(); 32 fn();
33 } catch (e) { 33 } catch (e) {
34 if (e is UnsupportedError) { 34 if (e is UnsupportedError) {
35 return; 35 return;
36 } 36 }
37 } 37 }
38 expect(true, isFalse, reason: 'Expected immutability error'); 38 expect(true, isFalse, reason: 'Expected immutability error');
39 }; 39 };
40 40
41 void expectEmptyStyleDeclaration(CSSStyleDeclaration style) { 41 void expectEmptyStyleDeclaration(CssStyleDeclaration style) {
42 expect(style.cssText, equals('')); 42 expect(style.cssText, equals(''));
43 expect(style.getPropertyPriority('color'), equals('')); 43 expect(style.getPropertyPriority('color'), equals(''));
44 expect(style.item(0), equals('')); 44 expect(style.item(0), equals(''));
45 expect(style.length, isZero); 45 expect(style.length, isZero);
46 // TODO(jacobr): these checks throw UnimplementedErrors in dartium. 46 // TODO(jacobr): these checks throw UnimplementedErrors in dartium.
47 // expect(style.parentRule, isNull); 47 // expect(style.parentRule, isNull);
48 // expect(style.getPropertyCssValue('color'), isNull); 48 // expect(style.getPropertyCssValue('color'), isNull);
49 // expect(style.getPropertyShorthand('color'), isNull); 49 // expect(style.getPropertyShorthand('color'), isNull);
50 // expect(style.isPropertyImplicit('color'), isFalse); 50 // expect(style.isPropertyImplicit('color'), isFalse);
51 51
52 // Ideally these would throw errors, but it's not possible to create a class 52 // Ideally these would throw errors, but it's not possible to create a class
53 // that'll intercept these calls without implementing the entire 53 // that'll intercept these calls without implementing the entire
54 // CSSStyleDeclaration interface, so we'll settle for them being no-ops. 54 // CssStyleDeclaration interface, so we'll settle for them being no-ops.
55 style.cssText = '* {color: blue}'; 55 style.cssText = '* {color: blue}';
56 style.removeProperty('color'); 56 style.removeProperty('color');
57 style.setProperty('color', 'blue'); 57 style.setProperty('color', 'blue');
58 } 58 }
59 59
60 group('constructors', () { 60 group('constructors', () {
61 test('0-argument makes an empty fragment', () { 61 test('0-argument makes an empty fragment', () {
62 final fragment = new DocumentFragment(); 62 final fragment = new DocumentFragment();
63 expect(fragment.children, equals([])); 63 expect(fragment.children, equals([]));
64 }); 64 });
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // // assertConstError(() => fragment.classes.add('foo')); 344 // // assertConstError(() => fragment.classes.add('foo'));
345 // }); 345 // });
346 346
347 test('query searches the fragment', () { 347 test('query searches the fragment', () {
348 var fragment = new DocumentFragment.html( 348 var fragment = new DocumentFragment.html(
349 "<div class='foo'><a>foo</a><b>bar</b></div>"); 349 "<div class='foo'><a>foo</a><b>bar</b></div>");
350 expect(fragment.query(".foo a").tagName, "A"); 350 expect(fragment.query(".foo a").tagName, "A");
351 expect(_nodeStrings(fragment.queryAll(".foo *")), equals(["A", "B"])); 351 expect(_nodeStrings(fragment.queryAll(".foo *")), equals(["A", "B"]));
352 }); 352 });
353 } 353 }
OLDNEW
« no previous file with comments | « tests/html/cssstyledeclaration_test.dart ('k') | tests/html/domparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698