Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/WebGLContextEvent.html

Issue 2447493002: Removed some duplicate layout tests under fast/canvas/webgl (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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 <script>
7
8 var evt;
9 var canvas;
10 var context;
11 var extension;
12
13 function createNewCanvas()
14 {
15 canvas = document.createElement("canvas");
16 canvas.width = 1;
17 canvas.height = 1;
18
19 context = WebGLTestUtils.create3DContext(canvas);
20 extension = context.getExtension("WEBGL_lose_context");
21 if (!extension) {
22 debug("Could not find the WEBGL_lose_context extension.");
23 return;
24 }
25 }
26
27 function runTest1()
28 {
29 if (window.initNonKhronosFramework)
30 window.initNonKhronosFramework(true);
31 createNewCanvas();
32 canvas.addEventListener("webglcontextlost", function(e) {
33 evt = e;
34 debug("Test that the event passed to a listener of webglcontextlost is a WebGLContextEvent.")
35 shouldBe("evt.toString()", "'[object WebGLContextEvent]'");
36 shouldBe("evt.statusMessage", "''");
37 // Start the next test when event dispatch has finished.
38 setTimeout(function() {
39 runTest2();
40 }, 0);
41 }, false);
42 extension.loseContext();
43 }
44
45 function runTest2()
46 {
47 createNewCanvas();
48 canvas.addEventListener("webglcontextlost", function(e) {
49 e.preventDefault();
50 // Restore the context after event dispatch has finished.
51 setTimeout(function() {
52 // Because context restoration is specified as being asynchronous, we can not verify
53 // that the GL error state is empty here.
54 extension.restoreContext();
55 }, 0);
56 }, false);
57 canvas.addEventListener("webglcontextrestored", function(e) {
58 evt = e;
59 shouldBe("context.getError()", "context.NO_ERROR");
60 debug("Test that the event passed to a listener of webglcontextrestored is a WebGLContextEvent.")
61 shouldBe("evt.toString()", "'[object WebGLContextEvent]'");
62 shouldBe("evt.statusMessage", "''");
63
64 setTimeout(finish, 0);
65 }, false);
66 extension.loseContext();
67 }
68
69 function finish() {
70 finishJSTest();
71 }
72
73 </script>
74
75 </head>
76 <body onload="runTest1()">
77 <div id="description"></div>
78 <div id="console"></div>
79 <canvas id="canvas">
80 </body>
81 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698