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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/dart/WindowAttrs-expected.txt ('k') | LayoutTests/dart/custom/lifecycle-exception.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/dart/custom/lifecycle-exception.dart
diff --git a/LayoutTests/dart/custom/lifecycle-exception.dart b/LayoutTests/dart/custom/lifecycle-exception.dart
new file mode 100644
index 0000000000000000000000000000000000000000..20af4825080812e21e77dd7d394872453c9c551d
--- /dev/null
+++ b/LayoutTests/dart/custom/lifecycle-exception.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:html';
+
+class Error extends HtmlElement {
+ Error.created() : super.created();
+
+ void attached() {
+ print('before attached throw');
+ throw 'attached error';
+ print('after attached throw');
+ }
+
+ void detached() {
+ print('before detached throw');
+ throw 'detached error';
+ print('after detached throw');
+ }
+
+ void attributeChanged() {
+ print('wrong number of arguments - this should never be reached');
+ }
+}
+
+class Error2 extends HtmlElement {
+ Error2.created() : super.created() {
+ throw 'Error2 cannot be created';
+ }
+}
+
+main() {
+ // Test Error.
+ try {
+ document.register('x-error', Error);
+ var element = document.createElement('x-error');
+ document.body.append(element);
+ try {
+ element.attached();
+ } catch(e) {
+ print('Caught direct throw');
+ }
+ element.setAttribute('foo', 'bar');
+ element.remove();
+ } catch (e) {
+ print('No error should be propagated here: $e');
+ }
+
+ // Test Error2.
+ try {
+ document.register('x-error2', Error2);
+ var element = document.createElement('x-error2');
+ print(element is Error2);
+ print(element is Element);
+ } catch (e) {
+ print('No error should be propagated here: $e');
+ }
+}
« 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