tor-browser

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

iframe-context-filtration.https.html (1113B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4  <script src="/resources/testharness.js"></script>
      5  <script src="/resources/testharnessreport.js"></script>
      6 
      7  <script src="resources/profile-utils.js"></script>
      8 </head>
      9 <body>
     10  <iframe src="resources/child-frame.html"></iframe>
     11 
     12  <script>
     13    promise_test(_ => new Promise(res => window.addEventListener('load', res)),
     14                 'wait for load event');
     15 
     16    promise_test(async t => {
     17      const profiler = new Profiler({
     18        sampleInterval: 10,
     19        maxBufferSize: Number.MAX_SAFE_INTEGER,
     20      });
     21 
     22      const iframe = frames[0];
     23      await ProfileUtils.forceSampleFrame(iframe);
     24 
     25      const trace = await profiler.stop();
     26 
     27      assert_false(ProfileUtils.containsFrame(trace, { name: 'sampleFromMessage' }),
     28                   'function from child context not included in trace');
     29 
     30      const childUrl = iframe.src;
     31      assert_false(ProfileUtils.containsResource(trace, childUrl),
     32                  'child resources are not included');
     33    }, 'functions from child frame are not included in profile created by parent frame');
     34  </script>
     35 </body>
     36 </html>