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

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

Issue 17552019: Reorganize mdv and observe packages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/mdv/pubspec.yaml ('k') | pkg/mdv/test/custom_element_bindings_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 binding_syntax_test; 5 library binding_syntax_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 'package:mdv_observe/mdv_observe.dart'; 10 import 'package:mdv/mdv.dart' as mdv;
11 import 'package:observe/observe.dart';
11 import 'package:unittest/html_config.dart'; 12 import 'package:unittest/html_config.dart';
12 import 'package:unittest/unittest.dart'; 13 import 'package:unittest/unittest.dart';
13 import 'mdv_observe_utils.dart'; 14 import 'observe_utils.dart';
14 15
15 // Note: this file ported from 16 // Note: this file ported from
16 // https://github.com/toolkitchen/mdv/blob/master/tests/syntax.js 17 // https://github.com/toolkitchen/mdv/blob/master/tests/syntax.js
17 18
18 main() { 19 main() {
20 mdv.initialize();
19 useHtmlConfiguration(); 21 useHtmlConfiguration();
20 group('Syntax', syntaxTests); 22 group('Syntax', syntaxTests);
21 } 23 }
22 24
23 syntaxTests() { 25 syntaxTests() {
24 var testDiv; 26 var testDiv;
25 27
26 setUp(() { 28 setUp(() {
27 document.body.append(testDiv = new DivElement()); 29 document.body.append(testDiv = new DivElement());
28 }); 30 });
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 class TimesTwoSyntax extends CustomBindingSyntax { 255 class TimesTwoSyntax extends CustomBindingSyntax {
254 getBinding(model, path, name, node) { 256 getBinding(model, path, name, node) {
255 path = path.trim(); 257 path = path.trim();
256 if (!path.startsWith('2x:')) return null; 258 if (!path.startsWith('2x:')) return null;
257 259
258 path = path.substring(3); 260 path = path.substring(3);
259 return new CompoundBinding((values) => values['value'] * 2) 261 return new CompoundBinding((values) => values['value'] * 2)
260 ..bind('value', model, path); 262 ..bind('value', model, path);
261 } 263 }
262 } 264 }
OLDNEW
« no previous file with comments | « pkg/mdv/pubspec.yaml ('k') | pkg/mdv/test/custom_element_bindings_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698