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

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

Issue 34453003: Rename mdv -> template_binding, remove experiemntal apis from dart:html (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
« no previous file with comments | « pkg/mdv/test/element_bindings_test.dart ('k') | pkg/mdv/test/node_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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library observe_utils;
6
7 import 'dart:html';
8 import 'package:observe/observe.dart';
9 import 'package:unittest/unittest.dart';
10
11 import 'package:observe/src/microtask.dart';
12 export 'package:observe/src/microtask.dart';
13
14 final bool parserHasNativeTemplate = () {
15 var div = new DivElement()..innerHtml = '<table><template>';
16 return div.firstChild.firstChild != null &&
17 div.firstChild.firstChild.tagName == 'TEMPLATE';
18 }();
19
20 recursivelySetTemplateModel(element, model, [delegate]) {
21 for (var node in element.queryAll('*')) {
22 if (node.isTemplate) {
23 node.bindingDelegate = delegate;
24 node.model = model;
25 }
26 }
27 }
28
29 dispatchEvent(type, target) {
30 target.dispatchEvent(new Event(type, cancelable: false));
31 }
32
33 class FooBarModel extends Observable {
34 @observable var foo;
35 @observable var bar;
36
37 FooBarModel([this.foo, this.bar]);
38 }
39
40 @reflectable
41 class FooBarNotifyModel extends ChangeNotifier implements FooBarModel {
42 var _foo;
43 var _bar;
44
45 FooBarNotifyModel([this._foo, this._bar]);
46
47 get foo => _foo;
48 set foo(value) {
49 _foo = notifyPropertyChange(#foo, _foo, value);
50 }
51
52 get bar => _bar;
53 set bar(value) {
54 _bar = notifyPropertyChange(#bar, _bar, value);
55 }
56 }
57
58 observeTest(name, testCase) => test(name, wrapMicrotask(testCase));
59
60 solo_observeTest(name, testCase) => solo_test(name, wrapMicrotask(testCase));
OLDNEW
« no previous file with comments | « pkg/mdv/test/element_bindings_test.dart ('k') | pkg/mdv/test/node_bindings_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698