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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/get-active-test.html

Issue 1601093008: Remove duplicated WebGL layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="resources/webgl-test.js"></script>
6 </head>
7 <body>
8 <div id="description"></div>
9 <div id="console"></div>
10
11 <script>
12 description("Test of getActiveAttrib and getActiveUniform");
13
14 if (window.internals)
15 window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
16
17 var context = create3DContext();
18 var context2 = create3DContext();
19 var program = loadStandardProgram(context);
20 var program2 = loadProgram(context2,
21 "resources/intArrayUniformShader.vert",
22 "resources/noopUniformShader.frag");
23
24 glErrorShouldBe(context, context.NO_ERROR);
25 shouldBe("context.getActiveUniform(program, 0).name", "'u_modelViewProjMatrix'") ;
26 shouldBe("context.getActiveUniform(program, 0).type", "context.FLOAT_MAT4");
27 shouldBe("context.getActiveUniform(program, 0).size", "1");
28 shouldBeNull("context.getActiveUniform(program, 1)");
29 glErrorShouldBe(context, context.INVALID_VALUE);
30 shouldBeNull("context.getActiveUniform(program, -1)");
31 glErrorShouldBe(context, context.INVALID_VALUE);
32 shouldBeNull("context.getActiveUniform(null, 0)");
33 glErrorShouldBe(context, context.INVALID_VALUE);
34
35 // we don't know the order the attribs will appear.
36 var info = [
37 context.getActiveAttrib(program, 0),
38 context.getActiveAttrib(program, 1)
39 ];
40 for (var ii = 0; ii < info.length; ++ii)
41 shouldBeNonNull("info[ii]");
42
43 var expected = [
44 { name: 'a_normal', type: context.FLOAT_VEC3, size: 1 },
45 { name: 'a_vertex', type: context.FLOAT_VEC4, size: 1 }
46 ];
47
48 if (info[0].name != expected[0].name) {
49 t = info[0];
50 info[0] = info[1];
51 info[1] = t;
52 }
53
54 for (var ii = 0; ii < info.length; ++ii) {
55 shouldBe("info[ii].name", "expected[ii].name");
56 shouldBe("info[ii].type", "expected[ii].type");
57 shouldBe("info[ii].size", "expected[ii].size");
58 }
59
60 // we don't know the order the uniforms will appear.
61 var info2 = [
62 context2.getActiveUniform(program2, 0),
63 context2.getActiveUniform(program2, 1)
64 ];
65 for (var ii = 0; ii < info2.length; ++ii)
66 shouldBeNonNull("info2[ii]");
67
68 var expected2 = [
69 { name: 'ival', type: context2.INT, size: 1 },
70 { name: 'ival2[0]', type: context2.INT, size: 2 }
71 ];
72
73 if (info2[0].name != expected2[0].name) {
74 t = info2[0];
75 info2[0] = info2[1];
76 info2[1] = t;
77 }
78
79 for (var ii = 0; ii < info2.length; ++ii) {
80 shouldBe("info2[ii].name", "expected2[ii].name");
81 shouldBe("info2[ii].type", "expected2[ii].type");
82 shouldBe("info2[ii].size", "expected2[ii].size");
83 }
84
85 shouldBeNull("context.getActiveAttrib(program, 2)");
86 glErrorShouldBe(context, context.INVALID_VALUE);
87 shouldBeNull("context.getActiveAttrib(program, -1)");
88 glErrorShouldBe(context, context.INVALID_VALUE);
89 shouldBeNull("context.getActiveAttrib(null, 0)");
90 glErrorShouldBe(context, context.INVALID_VALUE);
91
92 glErrorShouldBe(context2, context.NO_ERROR);
93
94 debug("Check trying to get attribs from different context");
95 shouldBeNull("context2.getActiveAttrib(program, 0)");
96 glErrorShouldBe(context2, context2.INVALID_OPERATION);
97 shouldBeNull("context2.getActiveUniform(program, 0)");
98 glErrorShouldBe(context2, context2.INVALID_OPERATION);
99
100 debug("Check trying to get attribs from deleted program");
101 context.deleteProgram(program);
102 shouldBeNull("context.getActiveUniform(program, 0)");
103 glErrorShouldBe(context, context.INVALID_VALUE);
104 shouldBeNull("context.getActiveAttrib(program, 0)");
105 glErrorShouldBe(context, context.INVALID_VALUE);
106 </script>
107
108 </body>
109 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698