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

Unified Diff: pkg/mdv/test/template_element_test.dart

Issue 17917002: Continue updating MDV. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged Created 7 years, 6 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 | « pkg/mdv/test/element_bindings_test.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/mdv/test/template_element_test.dart
diff --git a/pkg/mdv/test/template_element_test.dart b/pkg/mdv/test/template_element_test.dart
index c0ee1d367b37f50d7cb2aea37387dc4c1552e3b4..10b39e1618e7f0c5d9fdddae740324384e78b684 100644
--- a/pkg/mdv/test/template_element_test.dart
+++ b/pkg/mdv/test/template_element_test.dart
@@ -1047,27 +1047,37 @@ templateElementTests() {
expect(div.nodes[i++].text, 'Item 2');
});
- test('Attribute Template Option', () {
+ test('Attribute Template Option/Optgroup', () {
var div = createTestHtml(
'<template bind>'
'<select>'
- '<option template repeat>{{ val }}</option>'
+ '<optgroup template repeat="{{ groups }}" label="{{ name }}">'
+ '<option template repeat="{{ items }}">{{ val }}</option>'
+ '</optgroup>'
'</select>'
'</template>');
- var m = toSymbols([{ 'val': 0 }, { 'val': 1 }]);
+ var m = toSymbols({
+ 'selected': 1,
+ 'groups': [{
+ 'name': 'one', 'items': [{ 'val': 0 }, { 'val': 1 }]
+ }],
+ });
recursivelySetTemplateModel(div, m);
deliverChanges(m);
var select = div.nodes[0].nextNode;
- expect(select.nodes.length, 3);
+ expect(select.nodes.length, 2);
expect(select.nodes[0].tagName, 'TEMPLATE');
- expect(select.nodes[0].ref.content.nodes[0].tagName, 'OPTION');
- expect(select.nodes[1].tagName, 'OPTION');
- expect(select.nodes[1].text, '0');
- expect(select.nodes[2].tagName, 'OPTION');
- expect(select.nodes[2].text, '1');
+ expect(select.nodes[0].ref.content.nodes[0].tagName, 'OPTGROUP');
+
+ var optgroup = select.nodes[1];
+ expect(optgroup.nodes[0].tagName, 'TEMPLATE');
+ expect(optgroup.nodes[1].tagName, 'OPTION');
+ expect(optgroup.nodes[1].text, '0');
+ expect(optgroup.nodes[2].tagName, 'OPTION');
+ expect(optgroup.nodes[2].text, '1');
});
test('NestedIterateTableMixedSemanticNative', () {
@@ -1466,6 +1476,16 @@ templateElementTests() {
expect(root.text, 'Hi Leela');
});
+ test('BindShadowDOM Template Ref', () {
+ if (ShadowRoot.supported) {
+ var root = createShadowTestHtml(
+ '<template id=foo>Hi</template><template bind ref=foo></template>');
+ recursivelySetTemplateModel(root, toSymbolMap({}));
+ deliverChangeRecords();
+ expect(root.nodes.length, 3);
+ }
+ });
+
// https://github.com/toolkitchen/mdv/issues/8
test('UnbindingInNestedBind', () {
var div = createTestHtml(
« no previous file with comments | « pkg/mdv/test/element_bindings_test.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698