summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/browser/browser_realm_key_promise_frame.html
blob: dfb08085cf412ea09710d8d72bc3ae1d58ba9c3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<script type="text/javascript">
// Access to the top-level window property before getting access.
// This will create an entry in cross-origin realm map.
try {
  window.top.P;
} catch (e) {}

document.domain = "mochi.test";

// Ensure that frame's Object.prototype is accessible from top-level frame
// when getting incumbent global object inside Promise handling.
window.top.P.then(v => {
  if (v == 10) {
    window.top.document.getElementById("result").textContent = "OK";
  }
});
</script>