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

Side by Side Diff: pkg/polymer_expressions/test/syntax_test.dart

Issue 132403010: big update to observe, template_binding, polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:html'; 6 import 'dart:html';
7 7
8 import 'package:logging/logging.dart'; 8 import 'package:logging/logging.dart';
9 import 'package:observe/observe.dart'; 9 import 'package:observe/observe.dart';
10 import 'package:polymer_expressions/polymer_expressions.dart'; 10 import 'package:polymer_expressions/polymer_expressions.dart';
11 import 'package:template_binding/template_binding.dart'; 11 import 'package:template_binding/template_binding.dart';
12 import 'package:unittest/html_enhanced_config.dart'; 12 import 'package:unittest/html_config.dart';
13 import 'package:unittest/unittest.dart'; 13 import 'package:unittest/unittest.dart';
14 14
15 main() { 15 main() {
16 useHtmlEnhancedConfiguration(); 16 useHtmlConfiguration();
17 17
18 group('PolymerExpressions', () { 18 group('PolymerExpressions', () {
19 var testDiv; 19 var testDiv;
20 20
21 setUp(() { 21 setUp(() {
22 document.body.append(testDiv = new DivElement()); 22 document.body.append(testDiv = new DivElement());
23 }); 23 });
24 24
25 tearDown(() { 25 tearDown(() {
26 testDiv.firstChild.remove(); 26 testDiv.firstChild.remove();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // the template should be the only node 60 // the template should be the only node
61 expect(testDiv.nodes.length, 1); 61 expect(testDiv.nodes.length, 1);
62 expect(testDiv.nodes[0].id, 'test'); 62 expect(testDiv.nodes[0].id, 'test');
63 }); 63 });
64 64
65 test('should silently handle bad variable names', () { 65 test('should silently handle bad variable names', () {
66 var logger = new Logger('polymer_expressions'); 66 var logger = new Logger('polymer_expressions');
67 var logFuture = logger.onRecord.toList(); 67 var logFuture = logger.onRecord.toList();
68 testDiv.nodes.add(new Element.html(''' 68 testDiv.nodes.add(new Element.html('''
69 <template id="test" bind>{{ foo }}</template>''')); 69 <template id="test" bind>{{ foo }}</template>'''));
70 templateBind(query('#test')).bindingDelegate = new PolymerExpressions(); 70 templateBind(query('#test'))
71 ..bindingDelegate = new PolymerExpressions()
72 ..model = [];
71 return new Future(() { 73 return new Future(() {
72 logger.clearListeners(); 74 logger.clearListeners();
73 return logFuture.then((records) { 75 return logFuture.then((records) {
74 expect(records.length, 1); 76 expect(records.length, 1);
75 expect(records.first.message, 77 expect(records.first.message,
76 contains('Error evaluating expression')); 78 contains('Error evaluating expression'));
77 expect(records.first.message, contains('foo')); 79 expect(records.first.message, contains('foo'));
78 }); 80 });
79 }); 81 });
80 }); 82 });
(...skipping 23 matching lines...) Expand all
104 String getFullName() => '$_firstName $_lastName'; 106 String getFullName() => '$_firstName $_lastName';
105 107
106 List<String> get items => _items; 108 List<String> get items => _items;
107 109
108 void set items(List<String> value) { 110 void set items(List<String> value) {
109 _items = notifyPropertyChange(#items, _items, value); 111 _items = notifyPropertyChange(#items, _items, value);
110 } 112 }
111 113
112 String toString() => "Person(firstName: $_firstName, lastName: $_lastName)"; 114 String toString() => "Person(firstName: $_firstName, lastName: $_lastName)";
113 } 115 }
OLDNEW
« no previous file with comments | « pkg/polymer_expressions/test/globals_test.dart ('k') | pkg/template_binding/lib/src/binding_delegate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698