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

Side by Side Diff: pkg/mdv/test/template_element_test.dart

Issue 27602002: Renaming Node.document back to Node.ownerDocument (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 template_element_test; 5 library template_element_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:html'; 9 import 'dart:html';
10 import 'dart:math' as math; 10 import 'dart:math' as math;
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 observeTest('Content', () { 1516 observeTest('Content', () {
1517 var div = createTestHtml( 1517 var div = createTestHtml(
1518 '<template><a></a></template>' 1518 '<template><a></a></template>'
1519 '<template><b></b></template>'); 1519 '<template><b></b></template>');
1520 var templateA = div.nodes.first; 1520 var templateA = div.nodes.first;
1521 var templateB = div.nodes.last; 1521 var templateB = div.nodes.last;
1522 var contentA = templateA.content; 1522 var contentA = templateA.content;
1523 var contentB = templateB.content; 1523 var contentB = templateB.content;
1524 expect(contentA, isNotNull); 1524 expect(contentA, isNotNull);
1525 1525
1526 expect(templateA.document, isNot(equals(contentA.document))); 1526 expect(templateA.ownerDocument, isNot(equals(contentA.ownerDocument)));
1527 expect(templateB.document, isNot(equals(contentB.document))); 1527 expect(templateB.ownerDocument, isNot(equals(contentB.ownerDocument)));
1528 1528
1529 expect(templateB.document, templateA.document); 1529 expect(templateB.ownerDocument, templateA.ownerDocument);
1530 expect(contentB.document, contentA.document); 1530 expect(contentB.ownerDocument, contentA.ownerDocument);
1531 1531
1532 expect(templateA.document.window, window); 1532 expect(templateA.ownerDocument.window, window);
1533 expect(templateB.document.window, window); 1533 expect(templateB.ownerDocument.window, window);
1534 1534
1535 expect(contentA.document.window, null); 1535 expect(contentA.ownerDocument.window, null);
1536 expect(contentB.document.window, null); 1536 expect(contentB.ownerDocument.window, null);
1537 1537
1538 expect(contentA.nodes.last, contentA.nodes.first); 1538 expect(contentA.nodes.last, contentA.nodes.first);
1539 expect(contentA.nodes.first.tagName, 'A'); 1539 expect(contentA.nodes.first.tagName, 'A');
1540 1540
1541 expect(contentB.nodes.last, contentB.nodes.first); 1541 expect(contentB.nodes.last, contentB.nodes.first);
1542 expect(contentB.nodes.first.tagName, 'B'); 1542 expect(contentB.nodes.first.tagName, 'B');
1543 }); 1543 });
1544 1544
1545 observeTest('NestedContent', () { 1545 observeTest('NestedContent', () {
1546 var div = createTestHtml( 1546 var div = createTestHtml(
1547 '<template>' 1547 '<template>'
1548 '<template></template>' 1548 '<template></template>'
1549 '</template>'); 1549 '</template>');
1550 var templateA = div.nodes.first; 1550 var templateA = div.nodes.first;
1551 var templateB = templateA.content.nodes.first; 1551 var templateB = templateA.content.nodes.first;
1552 1552
1553 expect(templateB.document, templateA.content.document); 1553 expect(templateB.ownerDocument, templateA.content.ownerDocument);
1554 expect(templateB.content.document, templateA.content.document); 1554 expect(templateB.content.ownerDocument, templateA.content.ownerDocument);
1555 }); 1555 });
1556 1556
1557 observeTest('BindShadowDOM', () { 1557 observeTest('BindShadowDOM', () {
1558 if (ShadowRoot.supported) { 1558 if (ShadowRoot.supported) {
1559 var root = createShadowTestHtml( 1559 var root = createShadowTestHtml(
1560 '<template bind="{{}}">Hi {{ name }}</template>'); 1560 '<template bind="{{}}">Hi {{ name }}</template>');
1561 var model = toSymbolMap({'name': 'Leela'}); 1561 var model = toSymbolMap({'name': 'Leela'});
1562 recursivelySetTemplateModel(root, model); 1562 recursivelySetTemplateModel(root, model);
1563 deliverChanges(model); 1563 deliverChanges(model);
1564 expect(root.nodes[1].text, 'Hi Leela'); 1564 expect(root.nodes[1].text, 'Hi Leela');
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 } 1776 }
1777 return value; 1777 return value;
1778 } 1778 }
1779 1779
1780 /** 1780 /**
1781 * Sanitizer which does nothing. 1781 * Sanitizer which does nothing.
1782 */ 1782 */
1783 class NullTreeSanitizer implements NodeTreeSanitizer { 1783 class NullTreeSanitizer implements NodeTreeSanitizer {
1784 void sanitizeTree(Node node) {} 1784 void sanitizeTree(Node node) {}
1785 } 1785 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698