Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / context-release-upon-reload.html
blobb8dc24fe2335525452b9c5685e9ccec0f057d600
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>WebGL Context Release Test</title>
6 <script src="../../../resources/js-test.js"></script>
7 <script src="resources/webgl-test.js"></script>
8 </head>
9 <body>
10 <iframe id="host" style="width: 256px; height: 256px; border: 0;"></iframe>
11 <div id="description"></div>
12 <div id="console"></div>
13 <script>
14 description("This test ensures that WebGL contexts are released properly upon page reload");
16 window.jsTestIsAsync = true;
17 if (window.testRunner) {
18 testRunner.dumpAsText();
19 testRunner.waitUntilDone();
22 var host = document.getElementById("host");
23 var testIterations = 8;
24 var currentIteration = 0;
26 function refreshFrame() {
27 if(currentIteration < testIterations) {
28 currentIteration++;
29 host.src = "resources/context-release-upon-reload-child.html";
30 } else {
31 testPassed("All drawing buffers were allocated at the correct size");
32 finishTest();
36 function testContext() {
37 var bail = false;
38 var gl = host.contentWindow.glContext;
39 if (gl == null) {
40 bail = true;
41 testFailed("context was not created properly");
44 if (gl) {
45 var err = gl.getError();
46 if (err != gl.NO_ERROR) {
47 bail = true;
48 testFailed("Should be no GL error; got " + getGLErrorAsString(gl, err));
52 if (bail) {
53 finishTest();
54 return;
57 if (gl.canvas.width != gl.drawingBufferWidth ||
58 gl.canvas.height != gl.drawingBufferHeight) {
59 testFailed("At iteration " + currentIteration + " of " + testIterations +
60 ": Buffer was the wrong size: " +
61 gl.drawingBufferWidth + "x" + gl.drawingBufferHeight);
62 finishTest();
63 return;
64 } else {
65 refreshFrame();
68 gl = null;
71 window.addEventListener("message", function(event) {
72 if(event.data == "Ready") {
73 testContext();
75 });
77 refreshFrame();
78 </script>
80 </body>
81 </html>