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

Side by Side Diff: packages/polymer/test/prop_attr_bind_reflection_test.dart

Issue 2312183003: Removed Polymer from Observatory deps (Closed)
Patch Set: Created 4 years, 3 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
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:html';
6 import 'package:unittest/unittest.dart';
7 import 'package:unittest/html_config.dart';
8 import 'package:polymer/polymer.dart';
9
10 @CustomTag('my-child-element')
11 class MyChildElement extends PolymerElement {
12 @PublishedProperty(reflect: true) int camelCase;
13 @PublishedProperty(reflect: true) int lowercase;
14
15 // TODO(sigmund): remove once codegen in polymer is turned on.
16 @reflectable get attributes => super.attributes;
17
18 MyChildElement.created() : super.created();
19
20 // Make this a no-op, so we can verify the initial
21 // reflectPropertyToAttribute works.
22 @override
23 openPropertyObserver() {}
24 }
25
26 @CustomTag('my-element')
27 class MyElement extends PolymerElement {
28 @observable int volume = 11;
29
30 MyElement.created() : super.created();
31 }
32
33 main() => initPolymer().then((zone) => zone.run(() {
34 useHtmlConfiguration();
35
36 setUp(() => Polymer.onReady);
37
38 test('attribute reflected to property name', () {
39 var child = querySelector('my-element').shadowRoot
40 .querySelector('my-child-element');
41 expect(child.lowercase, 11);
42 expect(child.camelCase, 11);
43
44 expect(child.attributes['lowercase'], '11');
45 expect(child.attributes['camelcase'], '11');
46 });
47 }));
OLDNEW
« no previous file with comments | « packages/polymer/test/noscript_test.html ('k') | packages/polymer/test/prop_attr_bind_reflection_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698