Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2014, 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 library polymer.test.web.layout_test; | |
| 6 | |
| 7 import 'dart:async'; | |
| 8 import 'dart:html'; | |
| 9 import 'dart:js'; | |
| 10 import 'package:polymer/polymer.dart'; | |
| 11 import 'package:unittest/html_config.dart'; | |
| 12 import 'package:unittest/unittest.dart'; | |
| 13 | |
| 14 int elementsReadied = 0; | |
| 15 | |
| 16 @CustomTag('x-import') | |
| 17 class XImport extends PolymerElement { | |
| 18 XImport.created() : super.created(); | |
| 19 | |
| 20 ready() { | |
| 21 elementsReadied++; | |
| 22 } | |
| 23 } | |
| 24 | |
| 25 @CustomTag('x-main') | |
| 26 class XMain extends PolymerElement { | |
| 27 XMain.created() : super.created(); | |
| 28 | |
| 29 ready() { | |
| 30 elementsReadied++; | |
| 31 } | |
| 32 } | |
| 33 | |
| 34 main() => initPolymer().run(() { | |
| 35 useHtmlConfiguration(); | |
| 36 | |
| 37 setUp(() => Polymer.onReady); | |
| 38 | |
| 39 test('platform-less configuration', () { | |
| 40 var jsDoc = new JsObject.fromBrowserObject(document); | |
| 41 var htmlImports = context['HTMLImports']; | |
| 42 | |
| 43 if ((htmlImports == null || htmlImports['useNative'] != true) || | |
|
Siggi Cherem (dart-lang)
2014/09/09 21:21:43
could we simply do:
if (ShadowRoot.supported ||
jakemac
2014/09/10 16:29:59
done, nice
| |
| 44 new JsObject.fromBrowserObject( | |
| 45 jsDoc['documentElement'])['createShadowRoot'] == null || | |
| 46 jsDoc['registerElement'] == null) { | |
| 47 return; | |
| 48 } | |
| 49 | |
| 50 expect(elementsReadied, 2, reason: 'imported elements upgraded'); | |
| 51 }); | |
| 52 | |
| 53 }); | |
| OLD | NEW |