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

Side by Side Diff: tests/html/custom/constructor_calls_created_synchronously_test.dart

Issue 24251016: Revert "Dart2js support for custom element lifecycle events" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/custom/created_callback_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 constructor_calls_created_synchronously_test; 5 library constructor_calls_created_synchronously_test;
6 import 'package:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
7 import 'package:unittest/html_config.dart'; 7 import 'package:unittest/html_config.dart';
8 import 'dart:html'; 8 import 'dart:html';
9 import '../utils.dart';
10 9
11 class A extends HtmlElement { 10 class A extends HtmlElement {
12 static final tag = 'x-a'; 11 static final tag = 'x-a';
13 factory A() => new Element.tag(tag); 12 factory A() => new Element.tag(tag);
14 13
15 static int ncallbacks = 0; 14 static int ncallbacks = 0;
16 15
17 void created() { 16 void created() {
18 ncallbacks++; 17 ncallbacks++;
19 } 18 }
20 } 19 }
21 20
21 loadPolyfills() {
22 if (!document.supportsRegister) {
23 // Cache blocker is a workaround for:
24 // https://code.google.com/p/dart/issues/detail?id=11834
25 var cacheBlocker = new DateTime.now().millisecondsSinceEpoch;
26 return HttpRequest.getString('/root_dart/pkg/custom_element/lib/'
27 'custom-elements.debug.js?cacheBlock=$cacheBlocker').then((code) {
28 document.head.children.add(new ScriptElement()..text = code);
29 });
30 }
31 }
32
22 main() { 33 main() {
23 useHtmlConfiguration(); 34 useHtmlConfiguration();
24 35
25 // Adapted from Blink's 36 // Adapted from Blink's
26 // fast/dom/custom/constructor-calls-created-synchronously test. 37 // fast/dom/custom/constructor-calls-created-synchronously test.
27 38
28 setUp(loadPolyfills); 39 setUp(loadPolyfills);
29 40
30 test('createdCallback', () { 41 test('createdCallback', () {
31 document.register(A.tag, A); 42 document.register(A.tag, A);
32 var x = new A(); 43 var x = new A();
33 expect(A.ncallbacks, 1); 44 expect(A.ncallbacks, 1);
34 }); 45 });
35 } 46 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/custom/created_callback_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698