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

Unified Diff: LayoutTests/fast/dom/promise-rejection-events-lifetime.html

Issue 1215813003: Correctly track lifetime of promise rejection events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 6 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 | Source/bindings/core/v8/ScopedPersistent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/promise-rejection-events-lifetime.html
diff --git a/LayoutTests/fast/dom/promise-rejection-events-lifetime.html b/LayoutTests/fast/dom/promise-rejection-events-lifetime.html
new file mode 100644
index 0000000000000000000000000000000000000000..27e79da31fd5199ce7854f3acf0113dfbd8bc7d9
--- /dev/null
+++ b/LayoutTests/fast/dom/promise-rejection-events-lifetime.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+'use strict';
+async_test(function(t) {
+ var e;
+ var p = Promise.reject(new Error());
+
+ window.onunhandledrejection = function(evt) {
+ e = evt;
+ setTimeout(function() {
+ var unreached = t.unreached_func('promise should not be fulfilled');
+ p.then(unreached, function(reason) {});
+ p = undefined;
+ }, 10);
+ evt.preventDefault();
+ };
+
+ window.onrejectionhandled = function(evt) {
+ setTimeout(function() {
+ if (window.gc) {
+ gc();
+ }
+ t.step(function() {
+ assert_not_equals(e.reason, null);
+ assert_not_equals(e.promise, null);
+ });
+ t.done();
+ }, 10);
+ };
+}, 'evt.promise and evt.reason should live at least as long as evt');
+</script>
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScopedPersistent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698