Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(836)

Unified Diff: tests/html/custom/template_wrappers_test.dart

Issue 55153002: Adding test for old wrappers causing multiple upgrades (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/html/custom/template_wrappers_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/custom/template_wrappers_test.dart
diff --git a/tests/html/custom/template_wrappers_test.dart b/tests/html/custom/template_wrappers_test.dart
index 8754f857e190f273759182f261d1fac50236fe0d..3aeb8f54a795a776d9d14b144babf59a805f63c9 100644
--- a/tests/html/custom/template_wrappers_test.dart
+++ b/tests/html/custom/template_wrappers_test.dart
@@ -32,7 +32,6 @@ void customElementsTakeRecords() {
main() {
useHtmlConfiguration();
- var registeredTypes = false;
setUp(loadPolyfills);
test('element is upgraded once', () {
@@ -52,12 +51,30 @@ main() {
expect(createdCount, 1);
});
});
+
+ test('old wrappers do not cause multiple upgrades', () {
+ createdCount = 0;
+ var d1 = document.querySelector('x-custom-two');
+ d1.attributes['foo'] = 'bar';
+ d1 = null;
+
+ document.register('x-custom-two', CustomElement);
+
+ expect(createdCount, 1);
+
+ forceGC();
+
+ return new Future.delayed(new Duration(milliseconds: 50)).then((_) {
+ var d = document.querySelector('x-custom-two');
+ expect(createdCount, 1);
+ });
+ });
}
void forceGC() {
var N = 1000000;
- var M = 1000;
+ var M = 100;
blois 2013/10/31 18:43:13 Bumping down to 100 makes this quite a bit faster
siva 2013/10/31 19:49:05 This seems like a very contrived way to trigger a
for (var i = 0; i < M; ++i) {
var l = new List(N);
}
« no previous file with comments | « no previous file | tests/html/custom/template_wrappers_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698