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

Side by Side Diff: LayoutTests/dart/custom/lifecycle-exception.dart

Issue 1532413002: Added Dartium changes onto 45.0.2454.104 (Closed) Base URL: http://src.chromium.org/blink/branches/chromium/2454
Patch Set: Created 5 years 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
OLDNEW
(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 import 'dart:html';
6
7 class Error extends HtmlElement {
8 Error.created() : super.created();
9
10 void attached() {
11 print('before attached throw');
12 throw 'attached error';
13 print('after attached throw');
14 }
15
16 void detached() {
17 print('before detached throw');
18 throw 'detached error';
19 print('after detached throw');
20 }
21
22 void attributeChanged() {
23 print('wrong number of arguments - this should never be reached');
24 }
25 }
26
27 class Error2 extends HtmlElement {
28 Error2.created() : super.created() {
29 throw 'Error2 cannot be created';
30 }
31 }
32
33 main() {
34 // Test Error.
35 try {
36 document.register('x-error', Error);
37 var element = document.createElement('x-error');
38 document.body.append(element);
39 try {
40 element.attached();
41 } catch(e) {
42 print('Caught direct throw');
43 }
44 element.setAttribute('foo', 'bar');
45 element.remove();
46 } catch (e) {
47 print('No error should be propagated here: $e');
48 }
49
50 // Test Error2.
51 try {
52 document.register('x-error2', Error2);
53 var element = document.createElement('x-error2');
54 print(element is Error2);
55 print(element is Element);
56 } catch (e) {
57 print('No error should be propagated here: $e');
58 }
59 }
OLDNEW
« no previous file with comments | « LayoutTests/dart/WindowAttrs-expected.txt ('k') | LayoutTests/dart/custom/lifecycle-exception.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698