Test that the HTMLPortalElement/activate promise is rejected if detached.

The simplest way to achieve this is to just make a portal and try to
activate it straight away.

This code was previously unreachable in our tests:
  https://analysis.chromium.org/p/chromium/coverage/file?host=chromium.googlesource.com&project=chromium/src&ref=refs/heads/master&revision=f3878c07b1c5501e27ea0964d8a0ba0196cf7680&path=//third_party/blink/renderer/core/html/portal/html_portal_element.cc

Bug: 916310
Change-Id: I20cc6cbfb242e5466df6ffbbe0e30c065d6806ee
Reviewed-on: https://chromium-review.googlesource.com/c/1447030
Reviewed-by: Adithya Srinivasan <adithyas@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#627932}
diff --git a/portals/portals-activate-no-browsing-context.html b/portals/portals-activate-no-browsing-context.html
new file mode 100644
index 0000000..9a822e9
--- /dev/null
+++ b/portals/portals-activate-no-browsing-context.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+promise_test(async () => {
+  let activatePromise = document.createElement('portal').activate();
+  await activatePromise.then(() => assert_unreached(), e => {
+    assert_true(e instanceof DOMException);
+    assert_equals(e.name, 'InvalidStateError');
+  });
+}, "A portal with nothing in it cannot be activated");
+</script>