Revert "Bug 1977690 - Remove unused AppRequestInterceptor in androidTests r=aaronmt" for causing fenix-debug failures.
This reverts commit bc9dc5f4296482e17560627acaacd2797e462211.
<!--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>WebGL Uniform Buffers State Restoration Conformance Tests</title><linkrel="stylesheet"href="../../resources/js-test-style.css"/><scriptsrc="../../js/js-test-pre.js"></script><scriptsrc="../../js/webgl-test-utils.js"></script><scriptid='vshader'type='x-shader/x-vertex'>#version300eslayout(location=0)invec3p;voidmain(){gl_Position=vec4(p.xyz,1.0);}</script><scriptid='fshader'type='x-shader/x-fragment'>#version300esprecisionmediumpfloat;layout(location=0)outvec4oColor;uniformUBOData{vec4uboColor;};voidmain(){oColor=uboColor;}</script></head><body><divid="description"></div><canvasid="canvas"style="width: 50px; height: 50px;"></canvas><divid="console"></div><script>"use strict";description("This is a regression test verifying that uniform buffer bindings persist correctly across frames: <a href='http://crbug.com/722060'>crbug.com/722060</a>");debug("");varwtu=WebGLTestUtils;varcanvas=document.getElementById("canvas");vargl=wtu.create3DContext(canvas,null,2);vargreenBuf=null;varthrowawayBuf=null;varred=newFloat32Array([1,0,0,1]);vargreen=newFloat32Array([0,1,0,1]);varframe=0;if(!gl){testFailed("WebGL context does not exist");}else{testPassed("WebGL context exists");initTest();wtu.waitForComposite(runTest);}functioninitTest(){wtu.setupUnitQuad(gl);varprogram=wtu.setupProgram(gl,['vshader','fshader']);if(!program){testFailed("Could not compile shader with uniform blocks without error");return;}varuboLocation=gl.getUniformBlockIndex(program,"UBOData");gl.uniformBlockBinding(program,uboLocation,0);greenBuf=gl.createBuffer();throwawayBuf=gl.createBuffer();wtu.glErrorShouldBe(gl,gl.NO_ERROR,"createBuffer should not set an error");// Bind uniform buffer (both index 0 AND generic binding points) to greenBufgl.bindBufferBase(gl.UNIFORM_BUFFER,0,greenBuf);gl.bufferData(gl.UNIFORM_BUFFER,green,gl.STATIC_DRAW);// Bind throwaray uniform buffer (from only the generic binding point)gl.bindBuffer(gl.UNIFORM_BUFFER,throwawayBuf);}functionrunTest(){// ONLY the binding point at index 0 (not the generic binding point) should be greenBuf.// (The generic binding point should point at throwawayBuf.)// So this bufferData should go into throwawayBuf.gl.bufferData(gl.UNIFORM_BUFFER,red,gl.STATIC_DRAW);wtu.clearAndDrawUnitQuad(gl);wtu.checkCanvas(gl,[0,255,0,255],"draw call should set canvas to green",2);finishTest();}debug("");varsuccessfullyParsed=true;</script></body></html>