Revert "Bug 1972411 - give gnome-shell and pipewire more time to start, and retry the task if we time out. r=jmaher" for causing linux perma failures
This reverts commit 2b905fe7199c9210434f7c7f8326b57025c91c55.
Revert "Bug 1972411 - make /builds/worker/fetches a volume in the test docker image. r=releng-reviewers,Eijebong"
This reverts commit 9d15aecaf6a08b98d3c47f2d0e644e35341b2520.
<!doctype html><metacharset="utf-8"><title>Ensure Stream objects are created in expected globals. </title><scriptsrc="/resources/testharness.js"></script><scriptsrc="/resources/testharnessreport.js"></script><body></body><script>// These tests are loosely derived from Gecko's readable-stream-globals.js,// which is a test case designed around the JS Streams implementation.//// Unlike in JS Streams, where function calls switch realms and change// the resulting global of the resulting objects, in WebIDL streams,// the global of an object is (currently underspecified, but) intended// to be the "Relevant Global" of the 'this' object.//// See:// https://html.spec.whatwg.org/multipage/webappapis.html#relevant// https://github.com/whatwg/streams/issues/1213"use strict"constiframe=document.createElement("iframe")document.body.append(iframe)constotherGlobal=iframe.contentWindow;constOtherReadableStream=otherGlobal.ReadableStreamconstOtherReadableStreamDefaultReader=otherGlobal.ReadableStreamDefaultReader;constOtherReadableStreamDefaultController=otherGlobal.ReadableStreamDefaultController;promise_test(async()=>{// Controllersletcontroller;letotherController;// Get Stream Prototypes and controllers.letstreamController;letstream=newReadableStream({start(c){streamController=c;}});constcallReaderThisGlobal=OtherReadableStream.prototype.getReader.call(stream);constnewReaderOtherGlobal=newOtherReadableStreamDefaultReader(newReadableStream());// Relevant Global Checking.assert_equals(callReaderThisGlobalinstanceofReadableStreamDefaultReader,true,"reader was created in this global (.call)");assert_equals(newReaderOtherGlobalinstanceofReadableStreamDefaultReader,false,"reader was created in other global (new)");assert_equals(callReaderThisGlobalinstanceofOtherReadableStreamDefaultReader,false,"reader isn't coming from other global (.call)");assert_equals(newReaderOtherGlobalinstanceofOtherReadableStreamDefaultReader,true,"reader isn't coming from other global (new)");assert_equals(otherControllerinstanceofReadableStreamDefaultController,false,"otherController should come from other gloal")constrequest=callReaderThisGlobal.read();assert_equals(requestinstanceofPromise,true,"Promise comes from this global");streamController.close();constrequestResult=awaitrequest;assert_equals(requestResultinstanceofObject,true,"returned object comes from this global");},"Stream objects created in expected globals")promise_test(async()=>{conststream=newReadableStream();constotherReader=newOtherReadableStreamDefaultReader(stream);constcancelPromise=ReadableStreamDefaultReader.prototype.cancel.call(otherReader);assert_equals(cancelPromiseinstanceofPromise,true,"Cancel promise comes from the same global as the stream");assert_equals(awaitcancelPromise,undefined,"Cancel promise resolves to undefined");},"Cancel promise is created in same global as stream")// Refresh the streams and controllers.functiongetFreshInstances(){letcontroller;letotherController;letstream=newReadableStream({start(c){controller=c;}});newOtherReadableStream({start(c){otherController=c;}});return{stream,controller,otherController}}promise_test(async()=>{// Test closed promise on reader from another global (connected to a this-global stream)const{stream,controller,otherController}=getFreshInstances();constotherReader=newOtherReadableStreamDefaultReader(stream);constclosedPromise=otherReader.closed;assert_equals(closedPromiseinstanceofotherGlobal.Promise,true,"Closed promise in other global.");},"Closed Promise in correct global");promise_test(async()=>{const{stream,controller,otherController}=getFreshInstances();constotherReader=OtherReadableStream.prototype.getReader.call(stream);assert_equals(otherReaderinstanceofReadableStreamDefaultReader,true,"Reader comes from this global")constrequest=otherReader.read();assert_equals(requestinstanceofPromise,true,"Promise still comes from stream's realm (this realm)");otherController.close.call(controller);assert_equals((awaitrequest)instanceofotherGlobal.Object,true,"Object comes from other realm");},"Reader objects in correct global");promise_test(async()=>{const{stream,controller,otherController}=getFreshInstances();assert_equals(controller.desiredSize,1,"Desired size is expected");Object.defineProperty(controller,"desiredSize",Object.getOwnPropertyDescriptor(OtherReadableStreamDefaultController.prototype,"desiredSize"));assert_equals(controller.desiredSize,1,"Grafting getter from other prototype still returns desired size");},"Desired size can be grafted from one prototype to another");promise_test(async()=>{const{stream,controller,otherController}=getFreshInstances();// Make sure the controller close method returns the correct TypeErrorconstenqueuedError={name:"enqueuedError"};controller.error(enqueuedError);assert_throws_js(TypeError,()=>controller.close(),"Current Global controller");assert_throws_js(otherGlobal.TypeError,()=>otherController.close.call(controller),"Other global controller");},"Closing errored stream throws object in appropriate global")promise_test(async()=>{const{otherController}=getFreshInstances();// We can enqueue chunks from multiple globalsconstchunk={name:"chunk"};letcontroller;conststream=newReadableStream({start(c){controller=c;}},{size(){return1}});otherController.enqueue.call(controller,chunk);otherController.enqueue.call(controller,newotherGlobal.Uint8Array(10));controller.enqueue(newotherGlobal.Uint8Array(10));},"Can enqueue chunks from multiple globals")promise_test(async()=>{const{stream,controller,otherController}=getFreshInstances();constchunk={name:"chunk"};// We get the correct type errors out of a closed stream.controller.close();assert_throws_js(TypeError,()=>controller.enqueue(newotherGlobal.Uint8Array(10)));assert_throws_js(otherGlobal.TypeError,()=>otherController.enqueue.call(controller,chunk));assert_throws_js(otherGlobal.TypeError,()=>otherController.enqueue.call(controller,newotherGlobal.Uint8Array(10)));},"Correct errors and globals for closed streams");promise_test(async()=>{const{stream,controller,otherController}=getFreshInstances();// Branches out of tee are in the correct globalconst[branch1,branch2]=otherGlobal.ReadableStream.prototype.tee.call(stream);assert_equals(branch1instanceofReadableStream,true,"Branch created in this global (as stream is in this global)");assert_equals(branch2instanceofReadableStream,true,"Branch created in this global (as stream is in this global)");},"Tee Branches in correct global");</script>