| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library template_wrappers_test; | 5 library template_wrappers_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:js' as js; | 9 import 'dart:js' as js; |
| 10 import 'package:unittest/html_config.dart'; | 10 import 'package:unittest/html_config.dart'; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 return new Future.delayed(new Duration(milliseconds: 50)).then((_) { | 45 return new Future.delayed(new Duration(milliseconds: 50)).then((_) { |
| 46 var t = document.querySelector('.t1'); | 46 var t = document.querySelector('.t1'); |
| 47 | 47 |
| 48 var fragment = t.content; | 48 var fragment = t.content; |
| 49 | 49 |
| 50 fragment.querySelector('x-custom').checkCreated(); | 50 fragment.querySelector('x-custom').checkCreated(); |
| 51 expect(createdCount, 1); | 51 expect(createdCount, 1); |
| 52 }); | 52 }); |
| 53 }); | 53 }); |
| 54 | 54 /* |
| 55 test('old wrappers do not cause multiple upgrades', () { | 55 test('old wrappers do not cause multiple upgrades', () { |
| 56 createdCount = 0; | 56 createdCount = 0; |
| 57 var d1 = document.querySelector('x-custom-two'); | 57 var d1 = document.querySelector('x-custom-two'); |
| 58 d1.attributes['foo'] = 'bar'; | 58 d1.attributes['foo'] = 'bar'; |
| 59 d1 = null; | 59 d1 = null; |
| 60 | 60 |
| 61 document.register('x-custom-two', CustomElement); | 61 document.register('x-custom-two', CustomElement); |
| 62 | 62 |
| 63 expect(createdCount, 1); | 63 expect(createdCount, 1); |
| 64 | 64 |
| 65 forceGC(); | 65 forceGC(); |
| 66 | 66 |
| 67 return new Future.delayed(new Duration(milliseconds: 50)).then((_) { | 67 return new Future.delayed(new Duration(milliseconds: 50)).then((_) { |
| 68 var d = document.querySelector('x-custom-two'); | 68 var d = document.querySelector('x-custom-two'); |
| 69 expect(createdCount, 1); | 69 expect(createdCount, 1); |
| 70 }); | 70 }); |
| 71 }); | 71 }); |
| 72 */ |
| 72 } | 73 } |
| 73 | 74 |
| 74 | 75 |
| 75 void forceGC() { | 76 void forceGC() { |
| 76 var N = 1000000; | 77 var N = 1000000; |
| 77 var M = 100; | 78 var M = 100; |
| 78 for (var i = 0; i < M; ++i) { | 79 for (var i = 0; i < M; ++i) { |
| 79 var l = new List(N); | 80 var l = new List(N); |
| 80 } | 81 } |
| 81 } | 82 } |
| OLD | NEW |