Files
sdk/tests/html/range_test.dart
T
blois@google.com 93dedc90ab Adding tests for experimental Safe DOM creation technique.
This is just the underlying DOM creation code which should be able to parse HTML with no script execution. I'd like to get this in so we can make sure it works across all supported platforms. This does not do any sanitization or validation.

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org//14839006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22473 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 18:32:47 +00:00

30 lines
695 B
Dart

library range_test;
import 'dart:html';
import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_individual_config.dart';
main() {
useHtmlIndividualConfiguration();
group('supported', () {
test('supports_createContextualFragment', () {
expect(Range.supportsCreateContextualFragment, isTrue);
});
});
group('functional', () {
test('supported works', () {
var range = new Range();
range.selectNode(document.body);
var expectation = Range.supportsCreateContextualFragment ?
returnsNormally : throws;
expect(() {
range.createContextualFragment('<div></div>');
}, expectation);
});
});
}