tor-browser

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

window-open.mix.https.window.js (3166B)


      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: 'same-origin-1',
     13      children: [
     14        {
     15          id: 'same-origin-2',
     16          window_open: true,
     17          children: [
     18            {
     19              id: 'same-origin-3',
     20              window_open: true,
     21            },
     22          ],
     23        },
     24        {
     25          id: 'cross-origin-4',
     26          children: [
     27            {
     28              id: 'same-origin-5',
     29              window_open: true,
     30            },
     31          ],
     32        },
     33        {
     34          id: 'cross-site-6',
     35          children: [
     36            {
     37              id: 'same-origin-7',
     38              window_open: true,
     39            },
     40          ],
     41        },
     42        {
     43          id: 'same-origin-8',
     44          children: [
     45            {
     46              id: 'cross-origin-9',
     47              window_open: true,
     48              children: [
     49                {
     50                  id: 'same-origin-10',
     51                },
     52                {
     53                  id: 'same-origin-11',
     54                  window_open: true,
     55                },
     56              ],
     57            },
     58            {
     59              id: 'cross-site-12',
     60              window_open: true,
     61              children: [
     62                {
     63                  id: 'same-origin-13',
     64                },
     65                {
     66                  id: 'same-origin-14',
     67                  window_open: true,
     68                },
     69              ],
     70            },
     71          ],
     72        },
     73      ]
     74    },
     75  ]);
     76  const result = await performance.measureUserAgentSpecificMemory();
     77  checkMeasureMemory(result, [
     78    {
     79      url: window.location.href,
     80      scope: 'Window',
     81      container: null,
     82    },
     83    {
     84      url: windows['same-origin-1'].location.href,
     85      scope: 'Window',
     86      container: {
     87        id: 'same-origin-1',
     88        src: iframes['same-origin-1'].src,
     89      },
     90    },
     91    {
     92      url: windows['same-origin-2'].location.href,
     93      scope: 'Window',
     94      container: null,
     95    },
     96    {
     97      url: windows['same-origin-3'].location.href,
     98      scope: 'Window',
     99      container: null,
    100    },
    101    {
    102      url: 'cross-origin-url',
    103      scope: 'cross-origin-aggregated',
    104      container: {
    105        id: 'cross-origin-4',
    106        src: iframes['cross-origin-4'].src,
    107      },
    108    },
    109    {
    110      url: windows['same-origin-5'].location.href,
    111      scope: 'Window',
    112      container: null,
    113    },
    114    {
    115      url: 'cross-origin-url',
    116      scope: 'cross-origin-aggregated',
    117      container: {
    118        id: 'cross-site-6',
    119        src: iframes['cross-site-6'].src,
    120      },
    121    },
    122    {
    123      url: windows['same-origin-7'].location.href,
    124      scope: 'Window',
    125      container: null,
    126    },
    127    {
    128      url: windows['same-origin-8'].location.href,
    129      scope: 'Window',
    130      container: {
    131        id: 'same-origin-8',
    132        src: iframes['same-origin-8'].src,
    133      },
    134    },
    135  ]);
    136 }, 'performance.measureUserAgentSpecificMemory does not leak URLs in cross-origin iframes and windows.');