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

Side by Side Diff: pkg/polymer/test/attr_mustache_test.dart

Issue 24149003: Port of github.com/polymer/polymer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase 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/polymer/test/attr_deserialize_test.html ('k') | pkg/polymer/test/attr_mustache_test.html » ('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 import 'dart:async';
6 import 'dart:html';
7 import 'package:unittest/unittest.dart';
8 import 'package:unittest/html_config.dart';
9 import 'package:polymer/polymer.dart';
10
11 @CustomTag('x-target')
12 class XTarget extends PolymerElement {
13 final Completer _found = new Completer();
14 Future get foundSrc => _found.future;
15
16 // force an mdv binding
17 bind(name, model, path) =>
18 TemplateElement.mdvPackage(this).bind(name, model, path);
19
20 inserted() {
21 testSrcForMustache();
22 }
23
24 attributeChanged(name, oldValue) {
25 testSrcForMustache();
26 if (attributes[name] == '../testSource') {
27 _found.complete();
28 }
29 }
30
31 testSrcForMustache() {
32 expect(attributes['src'], isNot(matches(Polymer.bindPattern)),
33 reason: 'attribute does not contain {{...}}');
34 }
35 }
36
37 @CustomTag('x-test')
38 class XTest extends PolymerElement {
39 @observable var src = 'testSource';
40 }
41
42 main() {
43 useHtmlConfiguration();
44
45 test('mustache attributes', () {
46 final xtest = document.query('#test').xtag;
47 final xtarget = xtest.shadowRoot.query('#target').xtag;
48 return xtarget.foundSrc;
49 });
50 }
OLDNEW
« no previous file with comments | « pkg/polymer/test/attr_deserialize_test.html ('k') | pkg/polymer/test/attr_mustache_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698