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

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

Issue 19492018: [mdv] Avoid observing placeholder arrays in TemplateIterator (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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
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 657b177a4543006e4ad768badf56a27fcc1e69a1..1b2688f07a83c3fdfaa5e3c6550ad2520f9356cd 100644
--- a/pkg/mdv/test/template_element_test.dart
+++ b/pkg/mdv/test/template_element_test.dart
@@ -1368,6 +1368,25 @@ templateElementTests() {
expect(div.nodes[3].text, 'baz');
});
+ observeTest('Template - Same Contents, Different Array has no effect', () {
+ if (!MutationObserver.supported) return;
+
+ var div = createTestHtml('<template repeat>{{ foo }}</template>');
+
+ var m = toSymbols([{ 'foo': 'bar' }, { 'foo': 'bat'}]);
+ recursivelySetTemplateModel(div, m);
+ performMicrotaskCheckpoint();
+
+ var observer = new MutationObserver((records, _) {});
+ observer.observe(div, childList: true);
+
+ var template = div.firstChild;
+ template.bind('repeat', toObservable(m.toList()), '');
+ performMicrotaskCheckpoint();
+ var records = observer.takeRecords();
+ expect(records.length, 0);
+ });
+
observeTest('ChangeFromBindToRepeat', () {
var div = createTestHtml(
'<template bind="{{a}}">'

Powered by Google App Engine
This is Rietveld 408576698