Files
sdk/pkg/polymer/test/nested_binding_test.dart
T
jmesserly@google.com d9709470cc "Reverting 29728"
I changed the test to avoid using mirrors. Somehow, import mirrors exposes a strange dart2js interceptor bug, but only in unchecked mode. (I only ran checked mode in my local tests :|. Doh)
Needs more investigation, but what seems to be happening:

* setInnerHtml creates a document
* it tries to append <base> to the <head>
* interceptor gets "Document" instead of "HtmlDocument"
* so the `document.head` fails

The bug seems to require Shadow DOM+unchecked+mirrors. Anyway, since it's totally unrelated to this test or the bug fix for 14700, I'm just working around it for now. Will open a separate issue.

R=sigmund@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29767 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 19:59:45 +00:00

40 lines
1005 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';
import 'package:unittest/matcher.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);
}
}
main() {
initPolymer();
useHtmlConfiguration();
setUp(() => Polymer.onReady);
test('ready called', () => (query('my-test') as MyTest)._testDone.future);
}