Bug 1473375 [wpt PR 11780] - Don't crash when aborting a fetch in a destroyed context, a=testonly
authorAdam Rice <ricea@chromium.org>
Sat, 07 Jul 2018 00:27:45 +0000
changeset 426152 d6eef7f3762eaf4dc767bfcdafa831db644a9b00
parent 426151 410cf3c8e3e2ba776ef338f13f962a5996e5691b
child 426153 8e9a5ab5c1dae84e4b91419835cb0ea693b1b7e1
push id34267
push userrgurzau@mozilla.com
push dateWed, 11 Jul 2018 22:05:21 +0000
treeherdermozilla-central@3aca103e4915 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1473375, 11780, 860063, 1125543, 572493
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1473375 [wpt PR 11780] - Don't crash when aborting a fetch in a destroyed context, a=testonly Automatic update from web-platform-testsDon't crash when aborting a fetch in a destroyed context Once the context in which a fetch is executing has been destroyed the fetch cannot be aborted. blink::BodyStreamBuffer was attempting to abort the fetch anyway, leading to a crash. Check that the context hasn't been destroyed before attempting the abort. BUG=860063 Change-Id: I593dcbfe2f2dacd7be9df456399cd0328da7af39 Reviewed-on: https://chromium-review.googlesource.com/1125543 Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Commit-Queue: Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/master@{#572493} -- wpt-commits: bfba9da11d4c53a7d33785dfe5b2a5e96171bc7f wpt-pr: 11780
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/fetch/api/abort/destroyed-context.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -339232,16 +339232,22 @@
     ]
    ],
    "fetch/api/abort/cache.https.html": [
     [
      "/fetch/api/abort/cache.https.html",
      {}
     ]
    ],
+   "fetch/api/abort/destroyed-context.html": [
+    [
+     "/fetch/api/abort/destroyed-context.html",
+     {}
+    ]
+   ],
    "fetch/api/abort/general.any.js": [
     [
      "/fetch/api/abort/general.any.html",
      {}
     ],
     [
      "/fetch/api/abort/general.any.sharedworker.html",
      {}
@@ -571165,16 +571171,20 @@
   "fetch/README.md": [
    "fc07406a432360cd0f2f7650d9d34820568809e0",
    "support"
   ],
   "fetch/api/abort/cache.https.html": [
    "9465007a35059e9d72d4ab1dd8bff0d44f47c3d6",
    "testharness"
   ],
+  "fetch/api/abort/destroyed-context.html": [
+   "5cc67576c6b355dcb16b7934f075506b1ebc970b",
+   "testharness"
+  ],
   "fetch/api/abort/general.any.js": [
    "83da4c7859ee4d1a6a386b75c12b8a87e1347fe8",
    "testharness"
   ],
   "fetch/api/abort/serviceworker-intercepted.https.html": [
    "b5169e88b2146712ee98cd2c6f7575ce3f2999a3",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fetch/api/abort/destroyed-context.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+// This is a regression test for crbug.com/860063.
+window.controller = new AbortController();
+async_test(t => {
+  onmessage = t.step_func(event => {
+    assert_equals(event.data, 'started');
+    const iframe = document.querySelector('iframe');
+    document.body.removeChild(iframe);
+    controller.abort();
+    t.done();
+  });
+}, 'aborting a fetch in a destroyed context should not crash');
+</script>
+<iframe srcdoc="
+                <!DOCTYPE html>
+                <meta charset=utf-8>
+                <script>
+                fetch('../resources/infinite-slow-response.py', { signal: parent.controller.signal }).then(() => {
+                  parent.postMessage('started', '*');
+                });
+                </script>
+                ">
+</iframe>