Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / webgl-viewport-parameters-preserved.html
blob90b48df8fa5822bbabc5601445f1b069db5e6f6f
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 <script src="resources/webgl-test.js"></script>
5 <script src="resources/webgl-test-utils.js"> </script>
6 </head>
7 <body>
8 <div id="description"></div>
9 <div id="console"></div>
10 <script>
11 description("Checks that painting WebGL contents doesn't pollute the context's viewport state.");
13 var wtu = WebGLTestUtils;
15 if (window.testRunner) {
16 testRunner.dumpAsText();
17 testRunner.waitUntilDone();
20 var canvas;
21 var context;
23 function draw() {
24 var viewport = context.getParameter(context.VIEWPORT);
26 if (!areArraysEqual(viewport, [20, 20, 10, 10])) {
27 testFailed(viewport + " should be [20, 20, 10, 10]. Was " + viewport);
28 } else {
29 testPassed("Viewport not corrupted.");
32 if (window.testRunner)
33 testRunner.notifyDone();
36 window.onload = function()
38 if (window.initNonKhronosFramework) {
39 window.initNonKhronosFramework(false);
42 canvas = document.getElementById("webgl-canvas");
43 canvas.width = 50; canvas.height = 50;
44 context = create3DContext(canvas);
46 context.viewport(20, 20, 10, 10);
48 context.clearColor(255, 0, 0, 255);
49 context.clear(context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT);
51 // We need to ensure that the compositor has run before the drawing
52 // takes place. Setting a timeout of zero causes the compositor to run before
53 // the draw call. Using requestAnimationFrame caused the test to time-out.
54 setTimeout(draw, 0);
56 </script>
57 <canvas id="webgl-canvas" width="32px" height="32px"></canvas>
58 </body>
59 </html>