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

Side by Side Diff: third_party/webgl/sdk/tests/conformance/extensions/get-extension.html

Issue 10399113: Roll webgl conformance tests to r17874: part 2, adding r17874 (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 <!--
2
3 /*
4 ** Copyright (c) 2012 The Khronos Group Inc.
5 **
6 ** Permission is hereby granted, free of charge, to any person obtaining a
7 ** copy of this software and/or associated documentation files (the
8 ** "Materials"), to deal in the Materials without restriction, including
9 ** without limitation the rights to use, copy, modify, merge, publish,
10 ** distribute, sublicense, and/or sell copies of the Materials, and to
11 ** permit persons to whom the Materials are furnished to do so, subject to
12 ** the following conditions:
13 **
14 ** The above copyright notice and this permission notice shall be included
15 ** in all copies or substantial portions of the Materials.
16 **
17 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
24 */
25
26 -->
27
28 <!DOCTYPE html>
29 <html>
30 <head>
31 <meta charset="utf-8">
32 <title>WebGL Extension Conformance Tests</title>
33 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
34 <script src="../../resources/desktop-gl-constants.js" type="text/javascript"></s cript>
35 <script src="../../resources/js-test-pre.js"></script>
36 <script src="../resources/webgl-test.js"></script>
37 <script src="../resources/webgl-test-utils.js"></script>
38 </head>
39 <body>
40 <div id="description"></div>
41 <canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
42 <div id="console"></div>
43 <script>
44 var randomizeCase = function(str) {
45 var newChars = [];
46 for (var ii = 0; ii < str.length; ++ii) {
47 var c = str.substr(ii, 1);
48 var m = (Math.random() > 0.5) ? c.toLowerCase() : c.toUpperCase();
49 newChars.push(m);
50 }
51 return newChars.join("");
52 }
53
54 description();
55 debug("");
56
57 var wtu = WebGLTestUtils;
58 var canvas = document.getElementById("canvas");
59 var gl = wtu.create3DContext(canvas);
60
61 debug("check every extension advertised can be enabled");
62 var extensions = [];
63 var extensionNames = gl.getSupportedExtensions();
64 for (var ii = 0; ii < extensionNames.length; ++ii) {
65 var originalName = extensionNames[ii];
66 var mixedName = randomizeCase(originalName);
67 var extension = gl.getExtension(mixedName);
68 assertMsg(extension, "able to get " + originalName + " as " + mixedName);
69 if (extension) {
70 var kTestString = "this is a test";
71 var kTestNumber = 123;
72 var kTestFunction = function() { };
73 var kTestObject = { };
74 extension.testStringProperty = kTestString;
75 extension.testNumberProperty = kTestNumber;
76 extension.testFunctionProperty = kTestFunction;
77 extension.testObjectProperty = kTestObject;
78 var extension2 = gl.getExtension(originalName);
79 assertMsg(
80 extension === extension2,
81 "calling getExtension twice for the same extension returns the same object");
82 assertMsg(
83 extension2.testStringProperty === kTestString &&
84 extension2.testFunctionProperty === kTestFunction &&
85 extension2.testObjectProperty === kTestObject &&
86 extension2.testNumberProperty === kTestNumber,
87 "object returned by 2nd call to getExtension has same properties");
88 }
89 }
90
91 debug("");
92 successfullyParsed = true;
93 </script>
94 <script src="../../resources/js-test-post.js"></script>
95
96 </body>
97 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698