chromium/third_party/blink/web_tests/fast/dom/promise-rejection-events-lifetime.html

<!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>