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

Unified Diff: tests/html/element_test.dart

Issue 12040101: Adding supported checks for Element.matches. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/element_test.dart
diff --git a/tests/html/element_test.dart b/tests/html/element_test.dart
index d849731461416dd145b009b2f5ec86b0b6fa0bf7..80103cf136e7d52237e0545d78500ca19054d587 100644
--- a/tests/html/element_test.dart
+++ b/tests/html/element_test.dart
@@ -596,14 +596,23 @@ main() {
});
});
+ group('supported_matches', () {
+ test('supported', () {
+ expect(Element.supportsMatches, true);
+ });
+ });
+
group('matches', () {
test('matches', () {
- var element = new DivElement();
- element.classes.add('test');
-
- expect(element.matches('div'), true);
- expect(element.matches('span'), false);
- expect(element.matches('.test'), true);
+ var expectation = Element.supportsMatches ? returnsNormally : throws;
+ expect(() {
+ var element = new DivElement();
+ element.classes.add('test');
+
+ expect(element.matches('div'), true);
+ expect(element.matches('span'), false);
+ expect(element.matches('.test'), true);
+ }, expectation);
});
});
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698