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

Unified Diff: tests/html/document_test.dart

Issue 46313005: Fix to distingish Document from HtmlDocument on ie9 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/_internal/lib/native_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/document_test.dart
diff --git a/tests/html/document_test.dart b/tests/html/document_test.dart
index 2a543e751e63faaa64ebcd8bf2b6961a4a1b5a13..355a126e85a5939b927f1b65b4c64e91778b2653 100644
--- a/tests/html/document_test.dart
+++ b/tests/html/document_test.dart
@@ -13,6 +13,8 @@ main() {
var isUnknownElement =
predicate((x) => x is UnknownElement, 'is UnknownElement');
+ var inscrutable;
+
test('CreateElement', () {
// FIXME: nifty way crashes, do it boring way.
expect(new Element.tag('span'), isElement);
@@ -42,6 +44,8 @@ main() {
});
group('document', () {
+ inscrutable = (x) => x;
+
test('Document.query', () {
Document doc = new DomParser().parseFromString(
'''<ResultSet>
@@ -80,5 +84,23 @@ main() {
doc.body.nodes.add(div2);
expect(doc.query('#foo').text, 'bar');
});
+
+ test('typeTest1', () {
+ inscrutable = inscrutable(inscrutable);
+ var doc1 = document;
+ expect(doc1 is HtmlDocument, true);
+ expect(inscrutable(doc1) is HtmlDocument, true);
+ var doc2 = document.implementation.createHtmlDocument('');
+ expect(doc2 is HtmlDocument, true);
+ expect(inscrutable(doc2) is HtmlDocument, true);
+ });
+
+ test('typeTest2', () {
+ inscrutable = inscrutable(inscrutable);
+ // XML document.
+ var doc3 = document.implementation.createDocument(null, 'report', null);
+ expect(doc3 is HtmlDocument, false);
+ expect(inscrutable(doc3) is HtmlDocument, false);
+ });
});
}
« no previous file with comments | « sdk/lib/_internal/lib/native_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698