Files
sdk/tests/html/shadowroot_test.dart
T
blois@google.com f8e524535e Adding 'supported' check for shadow root.
This fixes the case for JS, but still throws for Dartium, I'll pass this onto Anton to fix the Dartium case to not throw.

BUG=5537

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12986 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 23:17:54 +00:00

25 lines
757 B
Dart

// 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.
#library('ShadowRootTest');
#import('../../pkg/unittest/unittest.dart');
#import('../../pkg/unittest/html_config.dart');
#import('dart:html');
main() {
useHtmlConfiguration();
test('ShadowRoot supported', () {
var isSupported = ShadowRoot.supported;
// If it's supported, then it should work. Otherwise should fail.
if (isSupported) {
var shadowRoot = new ShadowRoot(new DivElement());
expect(shadowRoot is ShadowRoot);
} else {
expect(() => new ShadowRoot(new DivElement()), throws);
}
});
}