tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

iframe.cross-site.https.window.js (1349B)


      1 // META: script=/common/get-host-info.sub.js
      2 // META: script=./resources/checker.js
      3 // META: script=./resources/common.js
      4 // META: timeout=long
      5 'use strict';
      6 
      7 promise_test(async testCase => {
      8  assert_true(self.crossOriginIsolated);
      9 
     10  const {iframes, windows} = await build([
     11    {
     12      id: 'cross-site-1',
     13      children: [
     14        {
     15          id: 'same-origin-2',
     16        },
     17        {
     18          id: 'cross-origin-3',
     19        },
     20        {
     21          id: 'cross-site-4',
     22        }
     23      ],
     24    },
     25  ]);
     26  try {
     27    const result = await performance.measureUserAgentSpecificMemory();
     28    checkMeasureMemory(result, [
     29      {
     30        url: window.location.href,
     31        scope: 'Window',
     32        container: null,
     33      },
     34      {
     35        url: 'cross-origin-url',
     36        scope: 'cross-origin-aggregated',
     37        container: {
     38          id: 'cross-site-1',
     39          src: iframes['cross-site-1'].src,
     40        },
     41      },
     42      {
     43        url: windows['same-origin-2'].location.href,
     44        scope: 'Window',
     45        container: {
     46          id: 'cross-site-1',
     47          src: iframes['cross-site-1'].src,
     48        },
     49      },
     50    ]);
     51  } catch (error) {
     52    if (!(error instanceof DOMException)) {
     53      throw error;
     54    }
     55    assert_equals(error.name, 'SecurityError');
     56  }
     57 }, 'performance.measureUserAgentSpecificMemory URLs within a cross-site iframe.');