Bug 1966586 - Reuse other browser windows when opening _blank links in Taskbar Tabs windows. r=nrishel
This doesn't affect other tab additions, nor does it stop the tab bar
from appearing altogether. The idea is that _if_ another tab is somehow
made, the user should see it; but we should not create new tabs if we
can avoid it.
This also adds tests for opening URIs in popups and taskbar tabs to make
it less likely that this breaks in future.
Differential Revision: https://phabricator.services.mozilla.com/D253726
<!--Copyright (c) 2019 The Khronos Group Inc.Use of this source code is governed by an MIT-style license that can befound in the LICENSE.txt file.--><!DOCTYPE html><html><head><metacharset="utf-8"><title>Multiple WebGL2 Context sharing texture2darray/texture3d data bug test</title><linkrel="stylesheet"href="../../resources/js-test-style.css"/><scriptsrc="../../js/js-test-pre.js"></script><scriptsrc="../../js/webgl-test-utils.js"></script></head><body><divid="description"></div><canvasid="canvas1"width="64"height="64"></canvas><canvasid="canvas2"width="64"height="64"></canvas><divid="console"></div><!-- WebGL 2 Shaders --><scriptid="vs"type="x-shader/x-vertex">#version300esprecisionmediumpfloat;invec4a_position;invec2a_coord;outvec2v_coord;voidmain(){gl_Position=a_position;v_coord=a_coord;}</script><scriptid="fs_texture_3d"type="x-shader/x-fragment">#version300esprecisionmediumpfloat;invec2v_coord;uniformmediumpsampler3Du_sampler;outvec4o_color;voidmain(){o_color=texture(u_sampler,vec3(v_coord,0.0));}</script><scriptid="fs_texture_2d_array"type="x-shader/x-fragment">#version300esprecisionmediumpfloat;invec2v_coord;uniformmediumpsampler2DArrayu_sampler;outvec4o_color;voidmain(){o_color=texture(u_sampler,vec3(v_coord,0.0));}</script><script>"use strict";description("This test verifies that 2 different contexts both using 2d array texture or 3d texture does not share the texture data among them due to context save/restore bug. https://bugs.chromium.org/p/chromium/issues/detail?id=788448");debug("");functionrender(gl,width,height,expectedColor,msg){wtu.setupUnitQuad(gl,0,1);wtu.clearAndDrawUnitQuad(gl);wtu.checkCanvasRect(gl,0,0,width,height,expectedColor,msg);}functionStateSetup(gl,texture_type,texture_color,width,height){// create a buffer to hold texture dataconstdepth=4;varsize=width*height*depth*4;varbuf=newUint8Array(size);for(vari=0;i<size;i+=4){buf[i+0]=texture_color[0];buf[i+1]=texture_color[1];buf[i+2]=texture_color[2];buf[i+3]=texture_color[3];}gl.viewport(0,0,width,height);// choose texture type and fragment shader typevartex_type=gl.TEXTURE_2D;varfragment_shader="",vertex_shader="vs";if(texture_type==="3d"){tex_type=gl.TEXTURE_3D,fragment_shader="fs_texture_3d";}elseif(texture_type==="2d_array"){tex_type=gl.TEXTURE_2D_ARRAY,fragment_shader="fs_texture_2d_array";}else{testFailed("Texture type must be 3d or 2darray");}varprogram=wtu.setupProgram(gl,[vertex_shader,fragment_shader],['a_position','a_coord'],[0,1]);// create a texturevartexture=gl.createTexture();gl.activeTexture(gl.TEXTURE0);// program texture parametersgl.activeTexture(gl.TEXTURE0);gl.bindTexture(tex_type,texture);gl.texImage3D(tex_type,0,gl.RGBA,width,height,depth,0,gl.RGBA,gl.UNSIGNED_BYTE,buf);gl.texParameteri(tex_type,gl.TEXTURE_MIN_FILTER,gl.NEAREST);gl.texParameteri(tex_type,gl.TEXTURE_MAG_FILTER,gl.NEAREST);// bind sampler to the texturevarsamplerLoc=gl.getUniformLocation(program,"u_sampler");gl.uniform1i(samplerLoc,0);// flush all gl commandsgl.flush();}varwtu=WebGLTestUtils;varcanvas1=document.getElementById("canvas1");vargl1=wtu.create3DContext(canvas1,null,2);//context1varcanvas2=document.getElementById("canvas2");vargl2=wtu.create3DContext(canvas2,null,2);// context2if(gl1&&gl2){testPassed("Created 2 WebGL2 context successfully");varred=[255,0,0,255],green=[0,255,0,255],blue=[0,0,255,255];varwidth=64,height=64;vartexture_type="3d",texture_color=green;StateSetup(gl1,texture_type,texture_color,width,height);// context1 state setuptexture_color=red;StateSetup(gl2,texture_type,texture_color,width,height);// context2 state setuprender(gl1,width,height,green,"Result pixels rendering from context1 with 3d texture should be green");// render context1texture_type="2d_array",texture_color=blue;StateSetup(gl1,texture_type,texture_color,width,height);// context1 state setuptexture_color=green;StateSetup(gl2,texture_type,texture_color,width,height);// context2 state setuprender(gl1,width,height,blue,"Result pixels rendering from context1 with 2darray texture should be blue");//render context1}elseif(!gl1){testFailed("Fail to get 1st WebGL2 context");}else{testFailed("Fail to get 2nd WebGL2 context");}debug("");varsuccessfullyParsed=true;</script><scriptsrc="../../js/js-test-post.js"></script></body></html>