ed4053dd04
R=sigmund@google.com Review URL: https://codereview.chromium.org//232373002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34908 260f80e4-7a28-3924-810f-c04153c831b5
40 lines
974 B
Dart
40 lines
974 B
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.
|
|
|
|
library polymer.test.nested_binding_test;
|
|
|
|
import 'dart:async';
|
|
import 'dart:html';
|
|
import 'package:polymer/polymer.dart';
|
|
import 'package:unittest/unittest.dart';
|
|
import 'package:unittest/html_config.dart';
|
|
|
|
@CustomTag('my-test')
|
|
class MyTest extends PolymerElement {
|
|
final List fruits = toObservable(['apples', 'oranges', 'pears']);
|
|
|
|
final _testDone = new Completer();
|
|
|
|
MyTest.created() : super.created();
|
|
|
|
_runTest(_) {
|
|
expect($['fruit'].text.trim(), 'Short name: [pears]');
|
|
_testDone.complete();
|
|
}
|
|
|
|
ready() {
|
|
onMutation($['fruit']).then(_runTest);
|
|
}
|
|
}
|
|
|
|
@initMethod
|
|
main() {
|
|
useHtmlConfiguration();
|
|
|
|
setUp(() => Polymer.onReady);
|
|
|
|
test('ready called',
|
|
() => (querySelector('my-test') as MyTest)._testDone.future);
|
|
}
|