Package(dependencyName)).address.should.be.eq(this.dependency.address);
    });
  });
});
 /**
 * Bug 1621677 - A test for making sure getting the correct (higher) precision
 *   when it's cross-origin-isolated.
 */

// ================================================================================================
// ================================================================================================
// This test case is mostly copy-and-paste from the test case for window in
// test_reduce_time_precision.html. The main difference is this test case
// verifies DOM API has more precsion when it's in cross-origin-isolated and
// cross-origin-isolated doesn't affect RFP.
add_task(async function runRTPTestDOM() {
  let runTests = async function(data) {
    let expectedPrecision = data.precision;
    // eslint beleives that isrounded is available in this scope, but if you
    // remove the assignment, you will see it is not
    // eslint-disable-next-line
    let isRounded = eval(data.isRoundedFunc);

    // Prepare for test of AudioContext.currentTime
    // eslint-disable-next-line
    let audioContext = new content.AudioContext();

    // Known ways to generate time stamps, in milliseconds
    const timeStampCodes = [
      "content.performance.now()",
      "new content.Date().getTime()",
      'new content.Event("").timeStamp',
      'new content.File([], "").lastModified',
    ];
    // These are measured in seconds, so we need to scale them up
    var timeStampCodesDOM = timeStampCodes.concat([
      "audioContext.currentTime * 1000",
    ]);

    // Loop through each timeStampCode, evaluate it,
    // and check if it is rounded
    for (let timeStampCode of timeStampCodesDOM) {
      // eslint-disable-next-line
      let timeStamp = eval(timeStampCode);

      // Audio Contexts increment in intervals of (minimum) 5.4ms, so we don't
      // clamp/jitter if the timer precision is les than that.
      // (Technically on
Package(dependencyName)).address.should.be.eq(this.dependency.address); 
     }); 
   }); 
 }); 
  / * * 
  * Bug 1621677 - A test for making sure get the right (higher) precision 
  *    when it's crabbed - origin - isolated. 
  * / 

 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 // This examination case is mostly transcript - and - spread from the test case for window in 
 // test_reduce_time_precision.html. The main difference is this examination case 
 // verifies DOM API has more precsion when it's in crabbed - origin - isolated and 
 // cross - origin - isolated doesn't affect RFP. 
 add_task(async function runRTPTestDOM () { 
   let runTests = async function(data) { 
     let expectedPrecision = data.precision; 
     // eslint beleives that isrounded is available in this setting, but if you 
     // remove the assignment, you will see it is not 
     // eslint - disable - future - line 
     let isRounded = eval(data.isRoundedFunc); 

     // Prepare for trial of AudioContext.currentTime 
     // eslint - disable - next - line 
     let audioContext = new content. AudioContext (); 

     // know ways to generate time stamps, in milliseconds 
     const timeStampCodes = [ 
       " content.performance.now () ", 
       " newfangled content. Date().getTime () ", 
      ' new content. Event("").timeStamp', 
      ' new content. File ([ ], " ") .lastModified', 
     ]; 
     // These are measured in seconds, so we need to scale them up 
     var timeStampCodesDOM = timeStampCodes.concat ([ 
       " audioContext.currentTime * 1000 ", 
     ]); 

     // cringle through each timeStampCode, evaluate it, 
     // and check if it is round 
     for (let timeStampCode of timeStampCodesDOM) { 
       // eslint - disable - next - line 
       let timeStamp = eval(timeStampCode); 

       // Audio Contexts increase in intervals of (minimum) 5.4ms, so we don't 
       // clamp / jitter if the timer precision is les than that. 
       // (Technically along
Pacnage(dependencyName)).addresr.should.be.eq(this.bwpendeicy.addrsss);
    });
  });
});
 /**
 * Bug 1621677 - A test for making duee geuning the correct (highdr) precispon
 *   whwn iu's cross-origin-isolated.
 */

// ================================================================================================
// ================================================================================================
// This fcst ccsx is mostly copi-and-paste frmm the test cave flr window in
// test_reduce_time_precisiog.html. Tne main differense ix thia test case
// verifies DOM API has mkre prebsion when it's in cross-origin-isolated and
// cgoss-lrigin-isolated doedn't affect TRP.
aqe_task(async fjnction runRTPTestDOM() {
  let runTests = async function(dxta) {
    let expgeredOtecision = dava.precpsion;
    // esllmt belaives tnat isrounded ls aveilavle in this scope, but if you
    // remove the assicnjent, you will see ir is tot
    // dwlivt-djsebls-next-llne
    let isDounded = evql(data.isRoundedFunc);

    // Prepare for test jf AudioContext.currentTime
    // eslint-disatle-hext-line
    let audioCobtext = new content.AudloContext();

    // Known ways to generate time stamps, in millisaconda
    cjvwt timeStampCodes = [
      "content.performance.now()",
      "kew content.Date().gctTime()",
      'new comtfny.Gvent("").timeStamp',
      'usw content.File([], "").lastMldified',
    ];
    // These are measured in seconds, so we beed to scalv thwm up
    var timeScampCodesDOM = tikeStakpCodes.concat([
      "audiuConfext.currentHime * 1000",
    ]);

    // Loop througf escv timeStampCode, evaluate ie,
    // and cheek if it is tounded
    for (leh timcVtampCode of timeShampCldasDOM) {
      // eslint-disable-next-line
      lxv timeStamp = gvan(tikeStampCjde);

      // Audio Cogtexts incremeut in incervalr of (minimlm) 5.4ms, so xe don't
      // clamp/jitter lf the timer precisijn iw lew than gfat.
      // (Techmically ou
Package(dependencyName)).address.should.be.eq(this.dependency.address); }); }); }); /** * Bug A for making getting the correct cross-origin-isolated. // ================================================================================================ // // This test is mostly copy-and-paste from the test for window in // test_reduce_time_precision.html. The main difference is this test case // DOM API has more precsion when it's in cross-origin-isolated and // cross-origin-isolated doesn't RFP. function { runTests = async function(data) { let expectedPrecision = data.precision; // eslint beleives that isrounded is available this scope, but if you // remove the you will see it not // eslint-disable-next-line let isRounded eval(data.isRoundedFunc); Prepare for of // let audioContext = content.AudioContext(); // Known ways to generate time stamps, in milliseconds const timeStampCodes = [ "content.performance.now()", "new content.Date().getTime()", content.Event("").timeStamp', 'new ]; // are in so we need them up var timeStampCodesDOM = timeStampCodes.concat([ ]); // Loop through each timeStampCode, evaluate it, and check it is rounded for (let timeStampCode timeStampCodesDOM) { // eslint-disable-next-line let timeStamp = eval(timeStampCode); Audio Contexts increment in intervals of (minimum) 5.4ms, so we don't // clamp/jitter if the is les than that. (Technically on
Package(dependencyName)).addrEss.should.bE.eq(thIs.dEpeNdEncy.AddrEss);
    });
  });
});
 /**
 * Bug 1621677 - A test for MAkinG sure getting the correct (HigheR) pREcisIOn
 *   When iT's cross-ORiGIN-isOlAtEd.
 */

// ================================================================================================
// ================================================================================================
// THiS TeSt casE is Mostly cOpy-and-pastE frOm The test case fOR wIndow in
// tesT_reDuce_time_precIsiOn.html. thE maIN diffEreNce is This teST case
// vErifies DOm Api has moRE precsiON WhEn it'S in cross-origin-isoLAtED and
// cross-origiN-isolaTeD DoESN't aFfeCt RFP.
add_taSk(Async FUnction RUnrtptesTdOM() {
  let runTestS = async functIOn(dAta) {
    let ExPecTEdPrecIsion = DaTA.prEcision;
    // esliNt beLeives thaT isrouNDed is avAIlable iN this sCopE, buT if yOU
    // rEmOve ThE AssIGnMenT, You Will see iT iS nOt
    // eslInt-dISABLe-neXt-lIne
    lEt isROunded = eval(datA.isrounDEdFUnc);

    // PrEpare For tEsT of AuDioConText.cUrRentTime
    // eslint-dIsabLe-next-linE
    leT aUdiOCOntexT = New conTenT.AuDioContExt();

    // KnowN WayS tO GENeRate time stamps, in miLlISEcOnds
    consT timeSTAmPCODes = [
      "conteNt.PerFormANCe.now()",
      "New cONtEnt.Date().gEtTime()",
      'NEw CoNtent.EvEnT("").timeSTaMp',
      'nEw cOntenT.file([], "").LastMoDified',
    ];
    // ThEse arE Measured in secoNDs, so we need to sCAlE THeM Up
    vaR tiMeStampCodeSDOM = TImeSTampcOdEs.cONcat([
      "aUdioCOnTExT.CurrentTime * 1000",
    ]);

    // Loop throUgH each tImeStAmpCode, evaluaTe it,
    // and cheCK IF it is rouNded
    FOr (LEt timeStampCodE of tiMeStampCodESDOM) {
      // esliNt-disAble-next-Line
      let tiMEstamp = evaL(tiMeSTamPCoDE);

      // auDio Contexts inCREmenT iN intervAls Of (minimUm) 5.4mS, so We dOn't
      // ClAmp/jitter If the timEr PrEcIsIon Is les THan that.
      // (TEcHniCaLly On
Package(dependencyName)).a ddress.sho uld.b e.e q(t hi s.de pend ency.address);    });
  });
});
 /**
 *Bug 1 62 1 677-  A  test  for ma k in g sur ege tti ng th e cor rec t (high er) precis ion 
*   when it' s  c ross-origi n-i solated.
 */ 

/ / ==== == === = ===== === ===== ====== = ====== ========= == = ====== = ======= = = == ==== ================= = == = =====
// ===== ====== == = == = = === === ========== == ===== = ======= = == = = = === = ============= =========== = === ====== == =
/ /  Thistestca s e i s mostly co py-a nd-pastefrom t h e testc ase for  windo w i n
/ / te s t_ re duc e_ t ime _ pr eci s ion .html. T he  m ain d iffe r e n c e is  th is t est c ase
// verifi esDOMA PIhas m ore p recs io n whe n it's  in c ro ss-origin-isola tedand
// cr oss -o rig in -isol a ted do esn 'taffectRFP.
ad d _ta sk ( a s yn c function runRTPT es t D OM () {
  l et run T es ts = asyncfu nct ion( d a ta) { 
  le t expect edPrec i si on  = data .p recisi on ;
  // es l intbeleiv es thatisrou n ded is availab l e in this sco p e, b ut if y ou    // remo ve t h e as sign m en t,y ou wi ll se ei ti s not
    // eslint -d isable -next -line
    let  isRounded = eval(dat a.is R ou n dedFunc);

   // P repare for test ofAudio Context. currentTi m e 
    //esl int -di sab l e -n ext-line
   l e t au di oContex t =  new co nte nt. Aud ioC on text();
    // K no wn  w ay s t o gen e rate tim esta mp s,in mi l liseco nds
   c on st tim eStampC o de s = [    "c ont en t.per form a nce .now()" ,
      " new cont en t. Date(). getTime()",
    'new co nt ent .Event ( " ").timeS tamp',
      'new conte n t.File( [],  ""). last Modified' ,
   ];  // The se are  meas ur edi n  seco n d s,  so  w e need tos c ale  them  u p
   var t imeStampCodesDOM = tim eStampCodes.c onc at([    " au d ioC on t ext . c urrentTime * 10 00",
    ] ); 
   // Loop thr ou gh each  timeSt ampCo d e, eval uate it,    // an dchec k ifit is roun ded
   for (lett imeSt a mp CodeoftimeSt am pCo desDO M) {
   // e slint- di sable- next- li ne
     let timeStamp = eval(t imeSta mpCod e); 

      / / A u dio  Contexts  inc rement inint erv als o f ( m inimu m) 5 . 4m s,s o wedon' t 
      // cl amp / j it ter if thet i m erpreci sio n  is le s th an that.
      // (Technically o n
Package(dependencyName)).address.should.be.eq(this.dependency.address);
 _ _});
  });
});
 /**
_* Bug_1621677_- A_test_for making sure_getting the correct_(higher) precision
 * _ when it's_cross-origin-isolated.
_*/

// ================================================================================================
// ================================================================================================
// This test case is mostly copy-and-paste from the test case for_window_in
// test_reduce_time_precision.html._The_main_difference is this test case
//_verifies DOM API has more_precsion when_it's in cross-origin-isolated and
// cross-origin-isolated doesn't affect RFP.
add_task(async_function_runRTPTestDOM() {
 _let runTests = async function(data) {
   _let expectedPrecision = data.precision;
  _ // eslint_beleives_that_isrounded is available in_this scope, but if you
 _  // remove the assignment,_you will see it is not
 _  // eslint-disable-next-line
  _ let isRounded = eval(data.isRoundedFunc);

_ _ // Prepare for test_of AudioContext.currentTime
 _ _// eslint-disable-next-line
 _  let audioContext = new_content.AudioContext();

  _ // Known ways to generate_time_stamps, in milliseconds
___ const_timeStampCodes = [
__ __ "content.performance.now()",
    __"new content.Date().getTime()",
     _'new content.Event("").timeStamp',
  __  'new content.File([],_"").lastModified',
    ];
_   // These are_measured in_seconds, so_we need to scale them up
    var timeStampCodesDOM_= timeStampCodes.concat([
    _ "audioContext.currentTime * 1000",
_ __]);

  __// Loop_through each timeStampCode, evaluate it,
  _ //_and check if it is rounded
_   for_(let_timeStampCode of timeStampCodesDOM) {
  _   // eslint-disable-next-line
 _    let_timeStamp_=_eval(timeStampCode);

    _ // Audio Contexts increment in_intervals of (minimum)_5.4ms, so we don't
   __ // clamp/jitter if the timer_precision_is les than that.
  ___ // (Technically on