Files
sdk/pkg/polymer/test/prop_attr_bind_reflection_test.dart
T
sigmund@google.com 68386823d1 Update polymer to commit b7200854b2441a22ce89f6563963f36c50f5150d
This brings over the changes to event dispatching.

R=blois@google.com

Review URL: https://codereview.chromium.org//44573005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29303 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-26 00:42:21 +00:00

44 lines
1.2 KiB
Dart

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:html';
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';
import 'package:polymer/polymer.dart';
@CustomTag('my-child-element')
class MyChildElement extends PolymerElement {
@published int camelCase;
@published int lowercase;
MyChildElement.created() : super.created();
// Make this a no-op, so we can verify the initial
// reflectPropertyToAttribute works.
observeAttributeProperty(name) { }
}
@CustomTag('my-element')
class MyElement extends PolymerElement {
@observable int volume = 11;
MyElement.created() : super.created();
}
main() {
initPolymer();
useHtmlConfiguration();
setUp(() => Polymer.onReady);
test('attribute reflected to property name', () {
var child = query('my-element').shadowRoot.query('my-child-element');
expect(child.lowercase, 11);
expect(child.camelCase, 11);
expect('11', child.attributes['lowercase']);
expect('11', child.attributes['camelcase']);
});
}