Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
aa2988b9
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
aa2988b9
编写于
3月 15, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 15, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2423 整改webgl用例
Merge pull request !2423 from 杨光宇/master
上级
fdfc1554
68c7f25b
变更
15
展开全部
隐藏空白更改
内联
并排
Showing
15 changed file
with
1737 addition
and
2388 deletion
+1737
-2388
graphic/webGL/src/main/js/default/test/List.test.js
graphic/webGL/src/main/js/default/test/List.test.js
+16
-1
graphic/webGL/src/main/js/default/test/WebGL.test02.js
graphic/webGL/src/main/js/default/test/WebGL.test02.js
+0
-76
graphic/webGL/src/main/js/default/test/WebGL.test03.js
graphic/webGL/src/main/js/default/test/WebGL.test03.js
+0
-119
graphic/webGL/src/main/js/default/test/WebGL.test04.js
graphic/webGL/src/main/js/default/test/WebGL.test04.js
+0
-82
graphic/webGL/src/main/js/default/test/WebGL.test05.js
graphic/webGL/src/main/js/default/test/WebGL.test05.js
+0
-90
graphic/webGL/src/main/js/default/test/WebGL.test06.js
graphic/webGL/src/main/js/default/test/WebGL.test06.js
+0
-98
graphic/webGL/src/main/js/default/test/WebGL.test07.js
graphic/webGL/src/main/js/default/test/WebGL.test07.js
+0
-413
graphic/webGL/src/main/js/default/test/WebGL.test09.js
graphic/webGL/src/main/js/default/test/WebGL.test09.js
+0
-176
graphic/webGL/src/main/js/default/test/WebGL.test10.js
graphic/webGL/src/main/js/default/test/WebGL.test10.js
+0
-393
graphic/webGL/src/main/js/default/test/WebGL.test11.js
graphic/webGL/src/main/js/default/test/WebGL.test11.js
+0
-16
graphic/webGL/src/main/js/default/test/WebGL.test12.js
graphic/webGL/src/main/js/default/test/WebGL.test12.js
+0
-240
graphic/webGL/src/main/js/default/test/WebGL.test13.js
graphic/webGL/src/main/js/default/test/WebGL.test13.js
+0
-70
graphic/webGL/src/main/js/default/test/WebGL.test14.js
graphic/webGL/src/main/js/default/test/WebGL.test14.js
+9
-156
graphic/webGL/src/main/js/default/test/WebGL.test15.js
graphic/webGL/src/main/js/default/test/WebGL.test15.js
+1712
-0
graphic/webGL/src/main/js/default/test/webGL.test.js
graphic/webGL/src/main/js/default/test/webGL.test.js
+0
-458
未找到文件。
graphic/webGL/src/main/js/default/test/List.test.js
浏览文件 @
aa2988b9
...
@@ -12,4 +12,19 @@
...
@@ -12,4 +12,19 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
require
(
'
./webGL.test.js
'
)
require
(
'
./WebGL.test01.js
'
)
require
(
'
./WebGL.test02.js
'
)
require
(
'
./WebGL.test03.js
'
)
require
(
'
./WebGL.test04.js
'
)
require
(
'
./WebGL.test05.js
'
)
require
(
'
./WebGL.test06.js
'
)
require
(
'
./WebGL.test07.js
'
)
require
(
'
./WebGL.test08.js
'
)
require
(
'
./WebGL.test09.js
'
)
require
(
'
./WebGL.test10.js
'
)
require
(
'
./WebGL.test11.js
'
)
require
(
'
./WebGL.test12.js
'
)
require
(
'
./WebGL.test13.js
'
)
require
(
'
./WebGL.test14.js
'
)
require
(
'
./WebGL.test15.js
'
)
\ No newline at end of file
graphic/webGL/src/main/js/default/test/WebGL.test02.js
浏览文件 @
aa2988b9
...
@@ -1137,28 +1137,6 @@ describe('webgl1Test', function() {
...
@@ -1137,28 +1137,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0136
* @tc.name webgl_test_endTransformFeedback
* @tc.desc Test endTransformFeedback.
*/
it
(
'
webgl_test_endTransformFeedback
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into endTransformFeedback
"
);
let
transformFeedback
=
gl2
.
createTransformFeedback
();
gl2
.
bindTransformFeedback
(
gl2
.
TRANSFORM_FEEDBACK
,
transformFeedback
);
gl2
.
beginTransformFeedback
(
gl
.
TRIANGLES
);
gl
.
drawArrays
(
gl
.
TRIANGLES
,
0
,
3
);
gl2
.
endTransformFeedback
();
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferTexture2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
NO_ERROR
);
//deleteContext();
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0137
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0137
* @tc.name webgl_test_deleteTransformFeedback
* @tc.name webgl_test_deleteTransformFeedback
...
@@ -2767,60 +2745,6 @@ describe('webgl1Test', function() {
...
@@ -2767,60 +2745,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0194
* @tc.name testGetProgramParameterFirst
* @tc.desc Test getProgramParameter.
*/
it
(
'
testGetProgramParameterFirst
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getProgramParameter test start ...
'
+
JSON
.
stringify
(
gl
));
const
program
=
gl
.
createProgram
();
gl
.
deleteProgram
(
program
);
const
deleteStatus
=
gl
.
getProgramParameter
(
program
,
gl
.
DELETE_STATUS
);
console
.
info
(
'
deleteStatus
'
+
deleteStatus
);
expect
(
deleteStatus
).
assertEqual
(
true
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0195
* @tc.name testGetProgramParameterSecond
* @tc.desc Test getProgramParameter.
*/
it
(
'
testGetProgramParameterSecond
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getProgramParameter test start ...
'
+
JSON
.
stringify
(
gl
));
const
program
=
gl
.
createProgram
();
gl
.
deleteProgram
(
program
);
gl
.
linkProgram
(
program
);
const
linkStatus
=
gl
.
getProgramParameter
(
program
,
gl
.
LINK_STATUS
);
console
.
info
(
'
linkStatus
'
+
linkStatus
);
expect
(
linkStatus
).
assertEqual
(
true
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0196
* @tc.name testGetProgramParameterThird
* @tc.desc Test getProgramParameter.
*/
it
(
'
testGetProgramParameterThird
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getProgramParameter test start ...
'
+
JSON
.
stringify
(
gl
));
const
program
=
gl
.
createProgram
();
gl
.
deleteProgram
(
program
);
gl
.
linkProgram
(
program
);
gl
.
validateProgram
(
program
);
const
validateStatus
=
gl
.
getProgramParameter
(
program
,
gl
.
VALIDATE_STATUS
);
console
.
info
(
'
validateStatus
'
+
validateStatus
);
expect
(
validateStatus
).
assertEqual
(
true
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0197
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0197
* @tc.name testGetProgramParameterFourth
* @tc.name testGetProgramParameterFourth
...
...
graphic/webGL/src/main/js/default/test/WebGL.test03.js
浏览文件 @
aa2988b9
...
@@ -362,24 +362,6 @@ describe('webgl1Test', function() {
...
@@ -362,24 +362,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0205
* @tc.name testGetShaderParameterFirst
* @tc.desc Test getShaderParameter.
*/
it
(
'
testGetShaderParameterFirst
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getShaderParameter test start ...
'
+
JSON
.
stringify
(
gl
));
const
vertexShader
=
gl
.
createShader
(
gl
.
VERTEX_SHADER
);
// const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
gl
.
deleteShader
(
vertexShader
);
const
deleteStatus
=
gl
.
getShaderParameter
(
vertexShader
,
gl
.
DELETE_STATUS
);
console
.
info
(
'
deleteStatus
'
+
deleteStatus
);
expect
(
deleteStatus
).
assertEqual
(
true
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0206
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0206
* @tc.name testGetShaderParameterSecond
* @tc.name testGetShaderParameterSecond
...
@@ -397,7 +379,6 @@ describe('webgl1Test', function() {
...
@@ -397,7 +379,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0207
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0207
* @tc.name testGetShaderParameterThird
* @tc.name testGetShaderParameterThird
...
@@ -620,23 +601,6 @@ describe('webgl1Test', function() {
...
@@ -620,23 +601,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0220
* @tc.name testGetParameter3
* @tc.desc Test getParameter.
*/
it
(
'
testGetParameter3
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getParameter test start ...
'
+
JSON
.
stringify
(
gl
));
const
buffer
=
gl
.
getParameter
(
gl
.
ARRAY_BUFFER_BINDING
);
console
.
info
(
"
buffer:
"
+
buffer
);
gl
.
bindBuffer
(
gl
.
ARRAY_BUFFER
,
buffer
);
const
isBuffer
=
gl
.
isBuffer
(
buffer
);
console
.
info
(
"
isBuffer:
"
+
isBuffer
);
expect
(
isBuffer
).
assertEqual
(
true
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0221
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0221
* @tc.name testGetParameter4
* @tc.name testGetParameter4
...
@@ -831,29 +795,6 @@ describe('webgl1Test', function() {
...
@@ -831,29 +795,6 @@ describe('webgl1Test', function() {
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0231
* @tc.name testGetVertexAttribFirst
* @tc.desc Test getVertexAttrib.
*/
it
(
'
testGetVertexAttribFirst
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getVertexAttrib test start ...
'
+
JSON
.
stringify
(
gl
));
const
vertexBuffer
=
gl
.
createBuffer
();
gl
.
bindBuffer
(
gl
.
ARRAY_BUFFER
,
vertexBuffer
);
const
shaderProgram
=
globalFunction
();
const
aVertexPosition
=
gl
.
getAttribLocation
(
shaderProgram
,
"
a_position
"
);
gl
.
enableVertexAttribArray
(
aVertexPosition
);
gl
.
vertexAttribPointer
(
aVertexPosition
,
3
,
gl
.
FLOAT
,
false
,
20
,
0
);
gl
.
drawArrays
(
gl
.
TRIANGLES
,
0
,
8
);
gl
.
vertexAttrib1f
(
0
,
2.8
);
const
type
=
gl
.
getVertexAttrib
(
0
,
gl
.
VERTEX_ATTRIB_ARRAY_ENABLED
);
console
.
info
(
"
getVertexAttrib: type
"
+
type
);
expect
(
type
).
assertEqual
(
true
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0232
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0232
...
@@ -1524,22 +1465,6 @@ describe('webgl1Test', function() {
...
@@ -1524,22 +1465,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0268
* @tc.name testGetShaderSourceError
* @tc.desc Test getShaderSource.
*/
it
(
'
testGetShaderSourceError
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getShaderSource test start ...
'
+
JSON
.
stringify
(
gl
));
var
shader
=
gl
.
createShader
(
gl
.
VERTEX_SHADER
);
var
source
=
gl
.
getShaderSource
(
shader
);
console
.
info
(
"
getShaderSource source:
"
+
source
);
expect
(
source
).
assertEqual
();
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0269
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0269
* @tc.name testGetShaderInfoLog
* @tc.name testGetShaderInfoLog
...
@@ -1618,50 +1543,6 @@ describe('webgl1Test', function() {
...
@@ -1618,50 +1543,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* createProgram
* getUniformBlockIndex
* getActiveUniformBlockName
*
*/
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0273
* @tc.name testGetActiveUniformBlockName
* @tc.desc Test getActiveUniformBlockName.
*/
it
(
'
testGetActiveUniformBlockName
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 getActiveUniformBlockName test start ...
'
+
JSON
.
stringify
(
gl2
));
const
program
=
gl
.
createProgram
();
const
blockIndex
=
gl2
.
getUniformBlockIndex
(
program
,
'
UBOData
'
);
console
.
info
(
"
getActiveUniformBlockName blockIndex
"
+
blockIndex
);
gl2
.
uniformBlockBinding
(
program
,
blockIndex
,
1
);
const
blockName
=
gl2
.
getActiveUniformBlockName
(
program
,
blockIndex
);
console
.
info
(
"
blockName
"
+
blockName
);
expect
(
blockName
).
assertEqual
(
'
UBOData
'
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0274
* @tc.name testUniformBlockBinding
* @tc.desc Test uniformBlockBinding.
*/
it
(
'
testUniformBlockBinding
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 uniformBlockBinding test start ...
'
+
JSON
.
stringify
(
gl2
));
const
program
=
gl
.
createProgram
();
const
blockIndex
=
gl2
.
getUniformBlockIndex
(
program
,
'
UBOData
'
);
gl2
.
uniformBlockBinding
(
program
,
blockIndex
,
1
);
const
blockName
=
gl2
.
getActiveUniformBlockName
(
program
,
blockIndex
);
console
.
info
(
"
blockName
"
+
blockName
);
expect
(
blockName
).
assertEqual
(
'
UBOData
'
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0275
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0275
* @tc.name testCreateVertexArray
* @tc.name testCreateVertexArray
...
...
graphic/webGL/src/main/js/default/test/WebGL.test04.js
浏览文件 @
aa2988b9
...
@@ -1454,23 +1454,6 @@ describe('webgl1Test', function() {
...
@@ -1454,23 +1454,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0365
* @tc.name testIsProgram_04
* @tc.desc Test isProgram.
*/
it
(
'
testIsProgram_04
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testIsProgram_04 test start ...66
'
);
var
texture
=
gl
.
createTexture
();
const
programError
=
gl
.
getError
();
console
.
info
(
"
createProgram --> programError:
"
+
programError
);
const
isProgram
=
gl
.
isProgram
(
texture
);
console
.
info
(
"
createProgram --> isProgram:
"
+
isProgram
);
expect
(
isProgram
).
assertEqual
(
true
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0366
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0366
* @tc.name testIsRenderbuffer
* @tc.name testIsRenderbuffer
...
@@ -1532,21 +1515,6 @@ describe('webgl1Test', function() {
...
@@ -1532,21 +1515,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0370
* @tc.name testIsRenderbuffer_04
* @tc.desc Test isRenderbuffer.
*/
it
(
'
testIsRenderbuffer_04
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testIsRenderbuffer_04 test start ...66
'
);
var
texture
=
gl
.
createTexture
();
const
isrenderbuffer
=
gl
.
isRenderbuffer
(
texture
);
console
.
info
(
"
createRenderbuffer --> isRenderbuffer:
"
+
isrenderbuffer
);
expect
(
isrenderbuffer
).
assertEqual
(
true
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0371
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0371
* @tc.name testIsShader
* @tc.name testIsShader
...
@@ -1698,24 +1666,6 @@ describe('webgl1Test', function() {
...
@@ -1698,24 +1666,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0381
* @tc.name testGetShaderParameter_1
* @tc.desc Test getShaderParameter.
*/
it
(
'
testGetShaderParameter_1
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getShaderParameter test start ...
'
+
JSON
.
stringify
(
gl
));
const
vertexShader
=
gl
.
createShader
(
gl
.
VERTEX_SHADER
);
// const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
gl
.
deleteShader
(
vertexShader
);
const
shaderType
=
gl
.
getShaderParameter
(
vertexShader
,
gl
.
SHADER_TYPE
);
console
.
info
(
'
shaderType
'
+
shaderType
);
expect
(
shaderType
).
assertEqual
(
120
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0382
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0382
* @tc.name testLineWidth
* @tc.name testLineWidth
...
@@ -1779,38 +1729,6 @@ describe('webgl1Test', function() {
...
@@ -1779,38 +1729,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0386
* @tc.name testLinkProgram_01
* @tc.desc Test linkProgram.
*/
it
(
'
testLinkProgram_01
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testLinkProgram_01 test start ...66
'
);
var
renderbuffer
=
gl
.
createRenderbuffer
();
gl
.
linkProgram
(
renderbuffer
);
const
linkProgramError
=
gl
.
getError
();
console
.
info
(
"
linkProgramError:
"
+
linkProgramError
);
expect
(
linkProgramError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0387
* @tc.name testLinkProgram_02
* @tc.desc Test linkProgram.
*/
it
(
'
testLinkProgram_02
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testLinkProgram_02 test start ...66
'
);
const
framebuffer
=
gl
.
createFramebuffer
();
gl
.
linkProgram
(
framebuffer
);
const
linkProgramError
=
gl
.
getError
();
console
.
info
(
"
linkProgramError:
"
+
linkProgramError
);
expect
(
linkProgramError
).
assertEqual
(
0
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0388
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0388
* @tc.name testLinkProgram_03
* @tc.name testLinkProgram_03
...
...
graphic/webGL/src/main/js/default/test/WebGL.test05.js
浏览文件 @
aa2988b9
...
@@ -1067,24 +1067,6 @@ describe('webgl1Test', function() {
...
@@ -1067,24 +1067,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0445
* @tc.name testUniform3fv_3
* @tc.desc Test uniform3fv.
*/
it
(
'
testUniform3fv_3
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testUniform3fv_3 test start ...66
'
);
const
renderbuffer
=
gl
.
createRenderbuffer
();
const
uniformlocationObj
=
gl
.
getUniformLocation
(
renderbuffer
,
"
a_Position
"
);
const
flaot32list
=
new
Float32Array
([
1
,
2
]);
gl
.
uniform3fv
(
uniformlocationObj
,
flaot32list
);
const
uniform3fvError
=
gl
.
getError
();
console
.
info
(
"
uniform3fvError:
"
+
uniform3fvError
);
expect
(
uniform3fvError
).
assertEqual
(
gl
.
NO_ERROR
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0446
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0446
* @tc.name testUniform3fv_4
* @tc.name testUniform3fv_4
...
@@ -1139,24 +1121,6 @@ describe('webgl1Test', function() {
...
@@ -1139,24 +1121,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0449
* @tc.name testUniform4fv_02
* @tc.desc Test uniform4fv.
*/
it
(
'
testUniform4fv_02
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testUniform4fv_02 test start ...66
'
);
const
renderbuffer
=
gl
.
createRenderbuffer
();
const
uniformlocationObj
=
gl
.
getUniformLocation
(
renderbuffer
,
"
a_Position
"
);
const
flaot32list
=
new
Float32Array
([
1
,
2
]);
gl
.
uniform4fv
(
uniformlocationObj
,
flaot32list
);
const
uniform4fvError
=
gl
.
getError
();
console
.
info
(
"
uniform4fvError:
"
+
uniform4fvError
);
expect
(
uniform4fvError
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0450
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0450
* @tc.name testUniform4fv_03
* @tc.name testUniform4fv_03
...
@@ -1337,24 +1301,6 @@ describe('webgl1Test', function() {
...
@@ -1337,24 +1301,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0460
* @tc.name testUniform2iv_03
* @tc.desc Test uniform2iv.
*/
it
(
'
testUniform2iv_03
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testUniform2iv_03 test start ...66
'
);
const
framebuffer
=
gl
.
createFramebuffer
();
const
uniformlocationObj
=
gl
.
getUniformLocation
(
framebuffer
,
"
a_Position
"
);
const
int32list
=
new
Int32Array
([
1
,
2
]);
gl
.
uniform2iv
(
uniformlocationObj
,
int32list
);
const
uniform2ivError
=
gl
.
getError
();
console
.
info
(
"
testUniform2ivError:
"
+
uniform2ivError
);
expect
(
uniform2ivError
).
assertEqual
(
gl
.
NO_ERROR
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0461
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0461
* @tc.name testUniform2iv_04
* @tc.name testUniform2iv_04
...
@@ -1409,24 +1355,6 @@ describe('webgl1Test', function() {
...
@@ -1409,24 +1355,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0464
* @tc.name testUniform3iv_02
* @tc.desc Test uniform3iv.
*/
it
(
'
testUniform3iv_02
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testUniform3iv_02 test start ...66
'
);
const
renderbuffer
=
gl
.
createRenderbuffer
();
const
uniformlocationObj
=
gl
.
getUniformLocation
(
renderbuffer
,
"
a_Position
"
);
const
int32list
=
new
Int32Array
([
1
,
2
]);
gl
.
uniform3iv
(
uniformlocationObj
,
int32list
);
const
uniform3ivError
=
gl
.
getError
();
console
.
info
(
"
testUniform3ivError:
"
+
uniform3ivError
);
expect
(
uniform3ivError
).
assertEqual
(
gl
.
NO_ERROR
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0465
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0465
* @tc.name testUniform3iv_03
* @tc.name testUniform3iv_03
...
@@ -1589,24 +1517,6 @@ describe('webgl1Test', function() {
...
@@ -1589,24 +1517,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0474
* @tc.name testUniformMatrix2fv_02
* @tc.desc Test uniformMatrix2fv.
*/
it
(
'
testUniformMatrix2fv_02
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testUniformMatrix2fv_02 test start ...66
'
);
const
buffer
=
gl
.
createBuffer
();
const
uniformlocationObj
=
gl
.
getUniformLocation
(
buffer
,
"
a_Position1
"
);
const
flaot32list
=
new
Float32Array
([
1
,
2
]);
gl
.
uniformMatrix2fv
(
uniformlocationObj
,
true
,
flaot32list
);
const
uniformMatrix2fvError
=
gl
.
getError
();
console
.
info
(
"
uniformMatrix2fvError:
"
+
uniformMatrix2fvError
);
expect
(
uniformMatrix2fvError
).
assertEqual
(
gl
.
NO_ERROR
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0475
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0475
* @tc.name testUniformMatrix2fv_03
* @tc.name testUniformMatrix2fv_03
...
...
graphic/webGL/src/main/js/default/test/WebGL.test06.js
浏览文件 @
aa2988b9
...
@@ -293,23 +293,6 @@ describe('webgl1Test', function() {
...
@@ -293,23 +293,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0501
* @tc.name testReadBuffer
* @tc.desc Test readBuffer.
*/
it
(
'
testReadBuffer
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testReadBuffer test start ...66
'
);
console
.
info
(
'
jsWebGL testReadBuffer test start ...
'
+
JSON
.
stringify
(
gl
));
gl2
.
readBuffer
(
gl
.
COLOR_ATTACHMENT0
);
const
readBufferError
=
gl
.
getError
();
console
.
info
(
"
readBufferError:
"
+
readBufferError
);
expect
(
readBufferError
).
assertEqual
(
0
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0502
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0502
* @tc.name testGetInternalformatParameter
* @tc.name testGetInternalformatParameter
...
@@ -393,33 +376,6 @@ describe('webgl1Test', function() {
...
@@ -393,33 +376,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0507
* @tc.name testGetTransformFeedbackVarying
* @tc.desc Test getTransformFeedbackVarying.
*/
it
(
'
testGetTransformFeedbackVarying
'
,
0
,
async
function
(
done
)
{
//initContext();
try
{
console
.
info
(
'
jsWebGL testGetTransformFeedbackVarying test start ...66
'
);
console
.
info
(
'
jsWebGL testGetTransformFeedbackVarying test start ...
'
+
JSON
.
stringify
(
gl
));
const
programObj
=
createProgram
(
gl
);
const
programError
=
gl
.
getError
();
console
.
info
(
"
programError:
"
+
programError
);
var
getTransformFeedbackVaryingobject
=
gl2
.
getTransformFeedbackVarying
(
programObj
,
0
);
console
.
info
(
"
getTransformFeedbackVaryingobject:
"
+
getTransformFeedbackVaryingobject
);
const
getTransformFeedbackVaryingError
=
gl
.
getError
();
console
.
info
(
"
getTransformFeedbackVaryingError:
"
+
getTransformFeedbackVaryingError
);
expect
(
getTransformFeedbackVaryingError
).
assertEqual
(
gl
.
NO_ERROR
);
//deleteContext();
done
();
}
catch
(
e
)
{
console
.
log
(
"
testGetTransformFeedbackVarying has failed for
"
+
e
)
expect
(
null
).
assertFail
()
}
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0508
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0508
* @tc.name testPauseTransformFeedback
* @tc.name testPauseTransformFeedback
...
@@ -1040,60 +996,6 @@ describe('webgl1Test', function() {
...
@@ -1040,60 +996,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0526
* @tc.name testGetActiveUniforms_07
* @tc.desc Test getActiveUniforms.
*/
it
(
'
testGetActiveUniforms_07
'
,
0
,
async
function
(
done
)
{
//initContext();
try
{
console
.
info
(
'
jsWebGL testGetActiveUniforms_07 test start ...66
'
);
//顶点着色器程序
var
VSHADER_SOURCE
=
'
attribute vec4 a_Position;
\n
'
+
'
void main() {
\n
'
+
'
gl_Position = a_Position;
\n
'
+
'
}
\n
'
;
// 片元着色器程序
var
FSHADER_SOURCE
=
'
precision mediump float;
\n
'
+
'
uniform vec4 u_FragColor;
\n
'
+
'
void main() {
\n
'
+
'
gl_FragColor = u_FragColor;
\n
'
+
'
}
\n
'
;
var
vertexShader
=
gl
.
createShader
(
gl
.
VERTEX_SHADER
);
gl
.
shaderSource
(
vertexShader
,
VSHADER_SOURCE
);
gl
.
compileShader
(
vertexShader
);
var
fragmentShader
=
gl
.
createShader
(
gl
.
FRAGMENT_SHADER
);
gl
.
shaderSource
(
fragmentShader
,
FSHADER_SOURCE
);
gl
.
compileShader
(
fragmentShader
);
const
programObj
=
gl
.
createProgram
();
console
.
log
(
"
testUseProgram has failed for
"
+
programObj
)
const
useProgramError1
=
gl
.
getError
();
console
.
info
(
"
useProgramError:
"
+
useProgramError1
);
const
renderBufferValue1
=
gl
.
getParameter
(
gl
.
CURRENT_PROGRAM
);
console
.
log
(
"
testUseProgram has failed for
"
+
renderBufferValue1
)
gl
.
attachShader
(
programObj
,
vertexShader
);
gl
.
attachShader
(
programObj
,
fragmentShader
);
gl
.
linkProgram
(
programObj
);
gl
.
useProgram
(
programObj
);
const
uniformIndices
=
[
-
1
,
-
2
,
-
3
];
const
uniformOffset
=
gl2
.
getActiveUniforms
(
programObj
,
uniformIndices
,
gl2
.
UNIFORM_IS_ROW_MAJOR
)
const
glintlist
=
[
-
1
,
false
,
false
];
//判断数据值是否正确
expect
(
uniformOffset
.
toString
()
!=
glintlist
.
toString
()).
assertEqual
(
true
);
//deleteContext();
done
();
}
catch
(
e
)
{
console
.
log
(
"
testGetActiveUniforms_07 has failed for
"
+
e
)
expect
(
null
).
assertFail
()
}
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0527
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0527
* @tc.name testUseProgram
* @tc.name testUseProgram
...
...
graphic/webGL/src/main/js/default/test/WebGL.test07.js
浏览文件 @
aa2988b9
...
@@ -497,7 +497,6 @@ describe('webgl1Test', function() {
...
@@ -497,7 +497,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0609
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0609
* @tc.name webgl_test_blendEquationSeparate2
* @tc.name webgl_test_blendEquationSeparate2
...
@@ -516,73 +515,6 @@ describe('webgl1Test', function() {
...
@@ -516,73 +515,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0610
* @tc.name webgl_test_blendFunc2
* @tc.desc Test blendFunc.
*/
it
(
'
webgl_test_blendFunc2
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into blendFunc
"
);
gl
.
enable
(
gl
.
BLEND
);
gl
.
blendFunc
(
gl
.
SRC_COLOR
);
const
blendFuncValue
=
gl
.
getParameter
(
gl
.
BLEND_SRC_RGB
);
console
.
info
(
"
blendFunc --> getParameter:
"
+
blendFuncValue
);
expect
(
blendFuncValue
).
assertEqual
(
gl
.
SRC_COLOR
);
//deleteContext();
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0611
* @tc.name webgl_test_blendFuncSeparate2
* @tc.desc Test blendFuncSeparate.
*/
it
(
'
webgl_test_blendFuncSeparate2
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into blendFuncSeparate
"
);
gl
.
enable
(
gl
.
BLEND
);
gl
.
blendFuncSeparate
(
gl
.
SRC_COLOR
,
gl
.
DST_COLOR
,
gl
.
ONE
);
const
blendFuncSeparateParameter
=
gl
.
getParameter
(
gl
.
BLEND_SRC_RGB
)
console
.
info
(
"
blendFuncSeparate --> getParameter:
"
+
blendFuncSeparateParameter
);
expect
(
blendFuncSeparateParameter
).
assertEqual
(
gl
.
SRC_COLOR
);
//deleteContext();
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0612
* @tc.name webgl_test_checkFramebufferStatus22
* @tc.desc Test checkFramebufferStatus.
*/
it
(
'
webgl_test_checkFramebufferStatus22
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into checkFramebufferStatus
"
);
// var framebuffer = gl.createFramebuffer();
gl
.
bindFramebuffer
(
gl
.
FRAMEBUFFER
,
'
framebuffer
'
);
const
checkFramebufferStatus
=
gl
.
checkFramebufferStatus
(
gl
.
FRAMEBUFFER
);
console
.
info
(
"
createFramebuffer --> bindFramebuffer --> checkFramebufferStatus:
"
+
checkFramebufferStatus
);
expect
(
checkFramebufferStatus
).
assertEqual
(
gl
.
FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
);
//deleteContext();
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0613
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0613
* @tc.name webgl_test_clear2
* @tc.name webgl_test_clear2
...
@@ -600,7 +532,6 @@ describe('webgl1Test', function() {
...
@@ -600,7 +532,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0614
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0614
* @tc.name webgl_test_clearColor2
* @tc.name webgl_test_clearColor2
...
@@ -704,28 +635,6 @@ describe('webgl1Test', function() {
...
@@ -704,28 +635,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0619
* @tc.name webgl_test_colorMask22
* @tc.desc Test colorMask.
*/
it
(
'
webgl_test_colorMask22
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into colorMask
"
);
gl
.
colorMask
(
true
,
true
,
2
,
false
);
// 要获取当前的颜色掩码,请查询COLOR_WRITEMASK返回Array.
const
colorMaskValue
=
gl
.
getParameter
(
gl
.
COLOR_WRITEMASK
);
// [true, true, true, false]
console
.
info
(
"
webgltest colorMask --> getParameter:
"
+
colorMaskValue
);
expect
(
colorMaskValue
.
toString
()).
assertEqual
(
'
true,true,true,false
'
);
//deleteContext();
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0620
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0620
* @tc.name webgl_test_colorMask_12
* @tc.name webgl_test_colorMask_12
...
@@ -746,28 +655,6 @@ describe('webgl1Test', function() {
...
@@ -746,28 +655,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0621
* @tc.name webgl_test_compileShader2
* @tc.desc Test compileShader.
*/
it
(
'
webgl_test_compileShader2
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into compileShader
"
);
var
shader
=
gl
.
createShader
(
gl
.
VERTEX_SHADER
);
gl
.
shaderSource
(
shader
,
1
);
gl
.
compileShader
(
shader
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest compileShader getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_FRAMEBUFFER_OPERATION
);
//deleteContext();
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0622
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0622
* @tc.name webgl_test_createProgram2
* @tc.name webgl_test_createProgram2
...
@@ -784,7 +671,6 @@ describe('webgl1Test', function() {
...
@@ -784,7 +671,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0623
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0623
* @tc.name webgl_test_createShader2
* @tc.name webgl_test_createShader2
...
@@ -1005,155 +891,6 @@ describe('webgl1Test', function() {
...
@@ -1005,155 +891,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0631
* @tc.name webgl_test_createQuery2
* @tc.desc Test createQuery.
*/
it
(
'
webgl_test_createQuery2
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into createQuery
"
);
const
query
=
gl2
.
createQuery
(
'
error
'
);
gl2
.
beginQuery
(
0x8C2F
,
query
);
const
currentQuery
=
gl2
.
getQuery
(
0x8C2F
,
0x8865
);
const
isQuery
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery:
"
+
isQuery
);
expect
(
isQuery
).
assertEqual
(
false
);
//deleteContext();
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0632
* @tc.name webgl_test_beginQuery2
* @tc.desc Test beginQuery.
*/
it
(
'
webgl_test_beginQuery2
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into beginQuery
"
);
var
query
=
gl2
.
createQuery
();
gl2
.
beginQuery
(
0x8C2F
,
'
query
'
);
const
currentQuery
=
gl2
.
getQuery
(
0x8C2F
,
0x8865
);
const
isQuery1
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery1:
"
+
isQuery1
);
expect
(
isQuery1
).
assertEqual
(
false
);
//deleteContext();
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0633
* @tc.name webgl_test_deleteQuery2
* @tc.desc Test deleteQuery.
*/
it
(
'
webgl_test_deleteQuery2
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into deleteQuery
"
);
var
query
=
gl2
.
createQuery
();
gl2
.
beginQuery
(
0x8C2F
,
query
);
const
currentQuery
=
gl2
.
getQuery
(
0x8C2F
,
0x8865
);
const
isQuery1
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery1:
"
+
isQuery1
);
expect
(
isQuery1
).
assertEqual
(
false
);
gl2
.
deleteQuery
(
'
currentQuery
'
);
const
isQuery2
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery deleteQuery isQuery2:
"
+
isQuery2
);
expect
(
isQuery2
).
assertEqual
(
false
);
//deleteContext();
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0634
* @tc.name webgl_test_beginQuery22
* @tc.desc Test beginQuery.
*/
it
(
'
webgl_test_beginQuery22
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into beginQuery
"
);
var
query
=
gl2
.
createQuery
();
gl2
.
beginQuery
(
0x8C2F
,
'
query
'
);
const
currentQuery
=
gl2
.
getQuery
(
0x8C2F
,
0x8865
);
const
isQuery1
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery1:
"
+
isQuery1
);
expect
(
isQuery1
).
assertEqual
(
false
);
//deleteContext();
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0635
* @tc.name webgl_test_endQuery2
* @tc.desc Test endQuery.
*/
it
(
'
webgl_test_endQuery2
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into endQuery
"
);
var
query
=
gl2
.
createQuery
();
gl2
.
beginQuery
(
0x8C2F
,
query
);
const
currentQuery
=
gl2
.
getQuery
(
0x8C2F
,
0x8865
);
const
isQuery1
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery1:
"
+
isQuery1
);
expect
(
isQuery1
).
assertEqual
(
false
);
gl2
.
endQuery
(
'
0x8C2F
'
);
const
isQuery2
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery2:
"
+
isQuery2
);
expect
(
isQuery2
).
assertEqual
(
false
);
//deleteContext();
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0636
* @tc.name webgl_test_getQueryParameter22
* @tc.desc Test getQueryParameter.
*/
it
(
'
webgl_test_getQueryParameter22
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into getQueryParameter
"
);
var
query
=
gl2
.
createQuery
();
gl2
.
beginQuery
(
0x8C2F
,
query
);
var
currentQuery
=
gl2
.
getQuery
(
0x8C2F
,
0x8865
);
const
isQuery1
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery1:
"
+
isQuery1
);
expect
(
isQuery1
).
assertEqual
(
false
);
// 返回一个GLboolean 指示查询结果是否可用。
var
result
=
gl2
.
getQueryParameter
(
currentQuery
,
'
0x8867
'
);
console
.
info
(
"
webgltest createQuery beginQuery getQueryParameter:
"
+
result
);
expect
(
result
).
assertEqual
(
undefined
);
//deleteContext();
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0637
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0637
* @tc.name webgl_test_createSampler2
* @tc.name webgl_test_createSampler2
...
@@ -2454,81 +2191,6 @@ describe('webgl1Test', function() {
...
@@ -2454,81 +2191,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0691
* @tc.name testTexImage2D_0428
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_0428
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexImage2D_0428 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl
.
RGB8
,
512
,
512
,
imgData
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0692
* @tc.name testTexImage2D_0428_01
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_0428_01
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexImage2D_0428_01 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texImage2D
(
-
gl
.
ONE_MINUS_DST_ALPHA
,
-
0
,
-
gl
.
RGB8
,
-
512
,
-
512
,
imgData
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
gl
.
INVALID_VALUE
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0693
* @tc.name testTexImage2D_0428_02
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_0428_02
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexImage2D_0428_02 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texImage2D
(
-
gl
.
ONE_MINUS_DST_ALPHA
,
-
0
,
-
gl
.
RGB8
,
-
gl
.
ONE_MINUS_DST_ALPHA
,
-
0
,
imgData
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
gl
.
INVALID_VALUE
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0694
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0694
* @tc.name testTexSubImage2D_01
* @tc.name testTexSubImage2D_01
...
@@ -2566,81 +2228,6 @@ describe('webgl1Test', function() {
...
@@ -2566,81 +2228,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0696
* @tc.name testTexSubImage2D_1
* @tc.desc Test texSubImage2D.
*/
it
(
'
testTexSubImage2D_1
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexSubImage2D_1 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texSubImage2D
(
gl
.
TEXTURE_2D
,
0
,
0
,
0
,
gl
.
RED
,
gl2
.
UNSIGNED_BYTE
,
imgData
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0697
* @tc.name testTexSubImage2D_1_01
* @tc.desc Test texSubImage2D.
*/
it
(
'
testTexSubImage2D_1_01
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexSubImage2D_1_01 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texSubImage2D
(
-
gl
.
TEXTURE_2D
,
-
0
,
-
0
,
-
0
,
-
gl
.
RED
,
-
gl2
.
UNSIGNED_BYTE
,
imgData
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assertEqual
(
gl
.
INVALID_ENUM
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0698
* @tc.desc Test texSubImage2D.
*/
it
(
'
testTexSubImage2D_1_02
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexSubImage2D_1_02 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texSubImage2D
(
gl
.
TEXTURE_2D
,
-
0
,
-
gl
.
TEXTURE_2D
,
-
0
,
-
gl
.
RED
,
-
gl2
.
UNSIGNED_BYTE
,
imgData
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0699
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0699
* @tc.name testBlitFramebuffer_01
* @tc.name testBlitFramebuffer_01
...
...
graphic/webGL/src/main/js/default/test/WebGL.test09.js
浏览文件 @
aa2988b9
...
@@ -293,27 +293,6 @@ describe('webgl1Test', function() {
...
@@ -293,27 +293,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0801
* @tc.name webgl_test_clearBufferfi24
* @tc.desc Test clearBufferfi.
*/
it
(
'
webgl_test_clearBufferfi24
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into clearBufferfi
"
);
gl2
.
clearBufferfi
(
gl
.
DEPTH_STENCIL
,
0
,
1.0
,
0
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest clearBufferfi getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_FRAMEBUFFER_OPERATION
);
//deleteContext();
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0802
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0802
* @tc.name webgl_test_beginQuery22
* @tc.name webgl_test_beginQuery22
...
@@ -335,58 +314,6 @@ describe('webgl1Test', function() {
...
@@ -335,58 +314,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0803
* @tc.name webgl_test_beginQuery23
* @tc.desc Test beginQuery.
*/
it
(
'
webgl_test_beginQuery23
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into beginQuery
"
);
var
query
=
gl2
.
createQuery
();
gl2
.
beginQuery
(
0x8D6A
,
query
);
const
currentQuery
=
gl2
.
getQuery
(
gl2
.
ANY_SAMPLES_PASSED_CONSERVATIVE
,
gl2
.
CURRENT_QUERY
);
// const currentQuery = gl2.getQuery(0x8D6A, 0x8865);
const
isQuery1
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery1:
"
+
isQuery1
);
expect
(
isQuery1
).
assertEqual
(
false
);
//deleteContext();
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0804
* @tc.name webgl_test_endQuery23
* @tc.desc Test endQuery.
*/
it
(
'
webgl_test_endQuery23
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into endQuery
"
);
var
query
=
gl2
.
createQuery
();
gl2
.
beginQuery
(
gl2
.
ANY_SAMPLES_PASSED_CONSERVATIVE
,
query
);
const
currentQuery
=
gl2
.
getQuery
(
gl2
.
ANY_SAMPLES_PASSED_CONSERVATIVE
,
gl2
.
CURRENT_QUERY
);
const
isQuery1
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery1:
"
+
isQuery1
);
expect
(
isQuery1
).
assertEqual
(
false
);
gl2
.
endQuery
(
0x8C2F
);
const
isQuery2
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery2:
"
+
isQuery2
);
expect
(
isQuery2
).
assertEqual
(
false
);
//deleteContext();
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0805
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0805
* @tc.name webgl_test_endQuery24
* @tc.name webgl_test_endQuery24
...
@@ -415,36 +342,6 @@ describe('webgl1Test', function() {
...
@@ -415,36 +342,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0806
* @tc.name webgl_test_getQuery23
* @tc.desc Test endQuery.
*/
it
(
'
webgl_test_getQuery23
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into endQuery
"
);
var
query
=
gl2
.
createQuery
();
gl2
.
beginQuery
(
gl2
.
ANY_SAMPLES_PASSED_CONSERVATIVE
,
query
);
const
currentQuery
=
gl2
.
getQuery
(
gl2
.
ANY_SAMPLES_PASSED_CONSERVATIVE
,
gl2
.
CURRENT_QUERY
);
const
isQuery1
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery1:
"
+
isQuery1
);
expect
(
isQuery1
).
assertEqual
(
false
);
gl2
.
endQuery
(
0x8C2F
);
const
isQuery2
=
gl2
.
isQuery
(
currentQuery
);
console
.
info
(
"
webgltest createQuery isQuery2:
"
+
isQuery2
);
expect
(
isQuery2
).
assertEqual
(
false
);
//deleteContext();
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0807
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0807
* @tc.name webgl_test_getQuery24
* @tc.name webgl_test_getQuery24
...
@@ -1050,79 +947,6 @@ describe('webgl1Test', function() {
...
@@ -1050,79 +947,6 @@ describe('webgl1Test', function() {
}
}
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0835
* @tc.name testGetUniformIndices_01_01
* @tc.desc Test getUniformIndices.
*/
it
(
'
testGetUniformIndices_01_01
'
,
0
,
async
function
(
done
)
{
//initContext();
try
{
console
.
info
(
'
jsWebGL testGetUniformIndices_01_01 test start ...66
'
);
console
.
info
(
'
jsWebGL testGetUniformIndices test start ...
'
+
JSON
.
stringify
(
gl
));
const
program
=
createProgram
(
gl
);
const
retuGLintptr
=
gl2
.
getUniformIndices
(
program
,
[
'
-1
'
,
'
-1
'
,
'
-1
'
]);
console
.
log
(
"
testGetUniformIndices_01_01 has failed for
"
+
retuGLintptr
)
const
int32list
=
[
-
1
,
-
1
,
-
1
];
console
.
log
(
"
testGetUniformIndices_01_01 has failed for
"
+
int32list
)
//判断数据类型是否正确
expect
(
int32list
==
'
String
'
).
assertEqual
(
false
);
//deleteContext();
done
();
}
catch
(
e
)
{
console
.
log
(
"
testGetUniformIndices_01_01 has failed for
"
+
e
)
expect
(
null
).
assertFail
()
}
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0836
* @tc.name testGetUniformIndices_01_02
* @tc.desc Test getUniformIndices.
*/
it
(
'
testGetUniformIndices_01_02
'
,
0
,
async
function
(
done
)
{
//initContext();
try
{
console
.
info
(
'
jsWebGL testGetUniformIndices_01_02 test start ...66
'
);
const
program
=
createProgram
(
gl
);
const
retuGLintptr
=
gl2
.
getUniformIndices
(
program
,
[
'
-0
'
,
'
-0
'
,
'
-0
'
]);
console
.
log
(
"
testGetUniformIndices_01_02 has failed for
"
+
retuGLintptr
)
const
int32list
=
[
-
1
,
-
1
,
-
1
];
console
.
log
(
"
testGetUniformIndices_01_02 has failed for
"
+
int32list
)
//判断数据类型是否正确
expect
(
int32list
==
'
String
'
).
assertEqual
(
false
);
//deleteContext();
done
();
}
catch
(
e
)
{
console
.
log
(
"
testGetUniformIndices_01_02 has failed for
"
+
e
)
expect
(
null
).
assertFail
()
}
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0837
* @tc.name testGetUniformIndices_01_03
* @tc.desc Test getUniformIndices.
*/
it
(
'
testGetUniformIndices_01_03
'
,
0
,
async
function
(
done
)
{
//initContext();
try
{
console
.
info
(
'
jsWebGL testGetUniformIndices_01_03 test start ...66
'
);
const
program
=
createProgram
(
gl
);
const
retuGLintptr
=
gl2
.
getUniformIndices
(
program
,
[
null
,
null
,
null
]);
console
.
log
(
"
testGetUniformIndices_01_03 has failed for
"
+
retuGLintptr
)
const
int32list
=
[
-
1
,
-
1
,
-
1
];
console
.
log
(
"
testGetUniformIndices_01_03 has failed for
"
+
int32list
)
//判断数据类型是否正确
expect
(
int32list
==
'
String
'
).
assertEqual
(
false
);
//deleteContext();
done
();
}
catch
(
e
)
{
console
.
log
(
"
testGetUniformIndices_01_03 has failed for
"
+
e
)
expect
(
null
).
assertFail
()
}
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0838
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0838
* @tc.name testPixelStorei_1_02
* @tc.name testPixelStorei_1_02
...
...
graphic/webGL/src/main/js/default/test/WebGL.test10.js
浏览文件 @
aa2988b9
...
@@ -365,156 +365,6 @@ describe('webgl1Test', function() {
...
@@ -365,156 +365,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0905
* @tc.name testTexImage2D_0428_01
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_0428_01
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexImage2D_0428_01 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texImage2D
(
gl
.
TEXTURE_CUBE_MAP_POSITIVE_X
,
0
,
gl
.
RGB8
,
512
,
512
,
imgData
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0906
* @tc.name testTexImage2D_0428_02
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_0428_02
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexImage2D_0428_02 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texImage2D
(
gl
.
TEXTURE_CUBE_MAP_NEGATIVE_X
,
0
,
gl
.
RGB8
,
512
,
512
,
imgData
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0907
* @tc.name testTexImage2D_0428_03
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_0428_03
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexImage2D_0428_03 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texImage2D
(
gl
.
TEXTURE_CUBE_MAP_POSITIVE_Y
,
0
,
gl
.
RGB8
,
512
,
512
,
imgData
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0908
* @tc.name testTexImage2D_0428_04
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_0428_04
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexImage2D_0428_04 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texImage2D
(
gl
.
TEXTURE_CUBE_MAP_NEGATIVE_Y
,
0
,
gl
.
RGB8
,
512
,
512
,
imgData
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0909
* @tc.name testTexImage2D_0428_05
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_0428_05
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexImage2D_0428_05 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texImage2D
(
gl
.
TEXTURE_CUBE_MAP_POSITIVE_Z
,
0
,
gl
.
RGB8
,
512
,
512
,
imgData
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0910
* @tc.name testTexImage2D_0428_06
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_0428_06
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexImage2D_0428_06 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texImage2D
(
gl
.
TEXTURE_CUBE_MAP_NEGATIVE_Z
,
0
,
gl
.
RGB8
,
512
,
512
,
imgData
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
0
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0911
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0911
* @tc.name testTexSubImage2D_1_01
* @tc.name testTexSubImage2D_1_01
...
@@ -629,189 +479,6 @@ describe('webgl1Test', function() {
...
@@ -629,189 +479,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0917
* @tc.name testTexSubImage2D_1_07
* @tc.desc Test texSubImage2D.
*/
it
(
'
testTexSubImage2D_1_07
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexSubImage2D_1_07 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_POSITIVE_X
,
0
,
0
,
0
,
gl
.
RED
,
gl2
.
UNSIGNED_BYTE
,
imgData
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0918
* @tc.name testTexSubImage2D_1_08
* @tc.desc Test texSubImage2D.
*/
it
(
'
testTexSubImage2D_1_08
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexSubImage2D_1_08 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_NEGATIVE_X
,
0
,
0
,
0
,
gl
.
RED
,
gl2
.
UNSIGNED_BYTE
,
imgData
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0919
* @tc.name testTexSubImage2D_1_09
* @tc.desc Test texSubImage2D.
*/
it
(
'
testTexSubImage2D_1_09
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexSubImage2D_1_09 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_POSITIVE_Y
,
0
,
0
,
0
,
gl
.
RED
,
gl2
.
UNSIGNED_BYTE
,
imgData
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0920
* @tc.name testTexSubImage2D_1_10
* @tc.desc Test texSubImage2D.
*/
it
(
'
testTexSubImage2D_1_10
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexSubImage2D_1_10 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_NEGATIVE_Y
,
0
,
0
,
0
,
gl
.
RED
,
gl2
.
UNSIGNED_BYTE
,
imgData
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0921
* @tc.name testTexSubImage2D_1_11
* @tc.desc Test texSubImage2D.
*/
it
(
'
testTexSubImage2D_1_11
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexSubImage2D_1_11 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_POSITIVE_Z
,
0
,
0
,
0
,
gl
.
RED
,
gl2
.
UNSIGNED_BYTE
,
imgData
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0922
* @tc.name testTexSubImage2D_1_12
* @tc.desc Test texSubImage2D.
*/
it
(
'
testTexSubImage2D_1_12
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testTexSubImage2D_1_12 test start ...66
'
);
let
canvas11
=
obj
.
$refs
.
canvas1
;
var
offCanvas2
=
canvas11
.
getContext
(
"
2d
"
);
var
imgData
=
offCanvas2
.
createImageData
(
300
,
500
);
console
.
info
(
"
webgl# loc success length:
"
+
imgData
.
data
.
length
);
for
(
var
i
=
0
;
i
<
imgData
.
data
.
length
;
i
+=
4
)
{
imgData
.
data
[
i
+
0
]
=
0
;
imgData
.
data
[
i
+
1
]
=
0
;
imgData
.
data
[
i
+
2
]
=
255
;
imgData
.
data
[
i
+
3
]
=
255
;
}
gl
.
texSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_NEGATIVE_Z
,
0
,
0
,
0
,
gl
.
RED
,
gl2
.
UNSIGNED_BYTE
,
imgData
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0923
* @tc.name testCopyBufferSubData_1_01
* @tc.desc Test copyBufferSubData.
*/
it
(
'
testCopyBufferSubData_1_01
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testCopyBufferSubData_1_01 test start ...66
'
);
const
srcBuffer
=
gl
.
createBuffer
();
const
dstBuffer
=
gl
.
createBuffer
();
const
vertices
=
[
1
,
2
];
const
data
=
new
Float32Array
(
vertices
);
const
length
=
vertices
.
length
*
4
;
gl
.
bindBuffer
(
gl
.
ARRAY_BUFFER
,
srcBuffer
);
gl
.
bufferData
(
gl
.
ARRAY_BUFFER
,
data
,
gl
.
STATIC_DRAW
);
gl
.
bindBuffer
(
gl
.
COPY_READ_BUFFER
,
srcBuffer
);
gl
.
bindBuffer
(
gl
.
ARRAY_BUFFER
,
dstBuffer
);
gl
.
bufferData
(
gl
.
ARRAY_BUFFER
,
new
Float32Array
(
length
),
gl
.
STATIC_DRAW
);
gl2
.
copyBufferSubData
(
gl
.
ELEMENT_ARRAY_BUFFER
,
gl
.
ARRAY_BUFFER
,
0
,
0
,
length
);
const
copyBufferSubDataError
=
gl
.
getError
();
console
.
info
(
"
copyBufferSubDataError:
"
+
copyBufferSubDataError
);
expect
(
copyBufferSubDataError
).
assertEqual
(
gl
.
INVALID_VALUE
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0924
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0924
* @tc.name testCopyBufferSubData_1_02
* @tc.name testCopyBufferSubData_1_02
...
@@ -962,26 +629,6 @@ describe('webgl1Test', function() {
...
@@ -962,26 +629,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0930
* @tc.name testGetBufferSubData_1_01
* @tc.desc Test getBufferSubData.
*/
it
(
'
testGetBufferSubData_1_01
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testGetBufferSubData_1_01 test start ...66
'
);
var
buffer
=
gl
.
createBuffer
();
gl
.
bindBuffer
(
gl
.
ARRAY_BUFFER
,
buffer
);
const
vertices
=
[
1
,
2
];
gl
.
bufferData
(
gl
.
ARRAY_BUFFER
,
new
Float32Array
(
vertices
),
gl
.
STATIC_DRAW
);
var
arrBuffer
=
new
ArrayBuffer
(
vertices
.
length
*
Float32Array
.
BYTES_PER_ELEMENT
);
gl2
.
getBufferSubData
(
gl
.
ELEMENT_ARRAY_BUFFER
,
0
,
new
Float32Array
(
arrBuffer
),
0
,
0
);
const
getBufferSubDataError
=
gl
.
getError
();
console
.
info
(
"
getBufferSubDataError:
"
+
getBufferSubDataError
);
expect
(
getBufferSubDataError
).
assertEqual
(
0
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0931
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0931
* @tc.name testGetBufferSubData_1_02
* @tc.name testGetBufferSubData_1_02
...
@@ -2253,46 +1900,6 @@ describe('webgl1Test', function() {
...
@@ -2253,46 +1900,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0991
* @tc.name testGetBufferParameter3
* @tc.desc Test getBufferParameter.
*/
it
(
'
testGetBufferParameter3
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getBufferParameter test start ...
'
+
JSON
.
stringify
(
gl
));
const
buffer
=
gl
.
createBuffer
();
gl
.
bindBuffer
(
gl
.
ARRAY_BUFFER
,
buffer
);
gl
.
bufferData
(
gl
.
ARRAY_BUFFER
,
1024
,
gl
.
STATIC_DRAW
);
const
bufferSize
=
gl
.
getBufferParameter
(
gl
.
ELEMENT_ARRAY_BUFFER
,
gl
.
BUFFER_SIZE
);
console
.
info
(
'
bufferSize
'
+
bufferSize
);
expect
(
bufferSize
).
assertEqual
(
8
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0992
* @tc.name testGetFramebufferAttachmentParameter1
* @tc.desc Test getFramebufferAttachmentParameter.
*/
it
(
'
testGetFramebufferAttachmentParameter1
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getFramebufferAttachmentParameter test start ...
'
+
JSON
.
stringify
(
gl
));
const
renderBuffer
=
gl
.
createRenderbuffer
();
gl
.
bindRenderbuffer
(
gl
.
RENDERBUFFER
,
renderBuffer
);
gl
.
framebufferRenderbuffer
(
gl
.
FRAMEBUFFER
,
gl
.
COLOR_ATTACHMENT0
,
gl
.
RENDERBUFFER
,
renderBuffer
);
const
framebuffer
=
gl
.
getFramebufferAttachmentParameter
(
gl
.
FRAMEBUFFER
,
gl
.
DEPTH_ATTACHMENT
,
gl
.
FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
);
console
.
info
(
'
Framebuffer
'
+
framebuffer
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
jsWebGL getFramebufferAttachmentParameter errorCode:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
NO_ERROR
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0993
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0993
* @tc.name testGetFramebufferAttachmentParameter2
* @tc.name testGetFramebufferAttachmentParameter2
...
...
graphic/webGL/src/main/js/default/test/WebGL.test11.js
浏览文件 @
aa2988b9
...
@@ -892,22 +892,6 @@ describe('webgl1Test', function() {
...
@@ -892,22 +892,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1035
* @tc.name testStencilMaskSeparate1
* @tc.desc Test stencilMaskSeparate.
*/
it
(
'
testStencilMaskSeparate1
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL stencilMaskSeparate test start ...
'
+
JSON
.
stringify
(
gl
));
gl
.
stencilMaskSeparate
(
gl
.
BACK
,
110101
);
const
stencilMaskSeparateParameter
=
gl
.
getParameter
(
gl
.
STENCIL_WRITEMASK
);
console
.
info
(
"
stencilMaskSeparate stencilMaskSeparateParameter:
"
+
stencilMaskSeparateParameter
);
expect
(
stencilMaskSeparateParameter
).
assertEqual
(
110101
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1036
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1036
* @tc.name testStencilMaskSeparate2
* @tc.name testStencilMaskSeparate2
...
...
graphic/webGL/src/main/js/default/test/WebGL.test12.js
浏览文件 @
aa2988b9
...
@@ -1272,79 +1272,6 @@ describe('webgl1Test', function() {
...
@@ -1272,79 +1272,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1156
* @tc.name testTexImage2D_1_1
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_1
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
RG16F
,
1
,
1
,
0
,
gl2
.
RG
,
gl2
.
HALF_FLOAT
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1157
* @tc.name testTexImage2D_1_2
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_2
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
R32F
,
1
,
1
,
0
,
gl2
.
RED
,
gl
.
FLOAT
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1158
* @tc.name testTexImage2D_1_3
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_3
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
RG32F
,
1
,
1
,
0
,
gl2
.
RG
,
gl
.
FLOAT
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1159
* @tc.name testTexImage2D_1_4
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_4
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
RG8UI
,
1
,
1
,
0
,
gl2
.
RG_INTEGER
,
gl
.
UNSIGNED_BYTE
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1160
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1160
* @tc.name testTexImage2D_1_5
* @tc.name testTexImage2D_1_5
...
@@ -1364,173 +1291,6 @@ describe('webgl1Test', function() {
...
@@ -1364,173 +1291,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1161
* @tc.name testTexImage2D_1_6
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_6
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
R11F_G11F_B10F
,
1
,
1
,
0
,
gl
.
RGB
,
gl2
.
UNSIGNED_INT_10F_11F_11F_REV
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1162
* @tc.name testTexImage2D_1_7
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_7
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
RGB9_E5
,
1
,
1
,
0
,
gl
.
RGB
,
gl2
.
HALF_FLOAT
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1163
* @tc.name testTexImage2D_1_8
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_8
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
RGB16F
,
1
,
1
,
0
,
gl
.
RGB
,
gl2
.
HALF_FLOAT
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1164
* @tc.name testTexImage2D_1_9
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_9
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
RGB32F
,
1
,
1
,
0
,
gl
.
RGB
,
gl
.
FLOAT
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1165
* @tc.name testTexImage2D_1_10
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_10
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
SRGB8_ALPHA8
,
1
,
1
,
0
,
gl
.
RGBA
,
gl
.
UNSIGNED_BYTE
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1166
* @tc.name testTexImage2D_1_11
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_11
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
RGB10_A2
,
1
,
1
,
0
,
gl
.
RGBA
,
gl2
.
UNSIGNED_INT_2_10_10_10_REV
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1167
* @tc.name testTexImage2D_1_12
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_12
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
RGBA16F
,
1
,
1
,
0
,
gl
.
RGBA
,
gl2
.
HALF_FLOAT
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1168
* @tc.name testTexImage2D_1_13
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_13
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
RGBA32F
,
1
,
1
,
0
,
gl
.
RGBA
,
gl
.
FLOAT
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1169
* @tc.name testTexImage2D_1_14
* @tc.desc Test texImage2D.
*/
it
(
'
testTexImage2D_1_14
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 texImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
var
buffer
=
new
ArrayBuffer
(
8
);
var
view
=
new
DataView
(
buffer
,
0
);
view
.
setInt16
(
1
,
42
);
gl2
.
texImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl2
.
RGBA8UI
,
1
,
1
,
0
,
gl2
.
RGBA_INTEGER
,
gl
.
UNSIGNED_BYTE
,
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1170
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1170
* @tc.name testTexImage2D_1_15
* @tc.name testTexImage2D_1_15
...
...
graphic/webGL/src/main/js/default/test/WebGL.test13.js
浏览文件 @
aa2988b9
...
@@ -428,23 +428,6 @@ describe('webgl1Test', function() {
...
@@ -428,23 +428,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1209
* @tc.name webgl_test_copyTexImage2D_1
* @tc.desc Test copyTexImage2D.
*/
it
(
'
webgl_test_copyTexImage2D_1
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
"
webgltest into copyTexImage2D
"
);
gl
.
copyTexImage2D
(
gl
.
TEXTURE_2D
,
0
,
gl
.
LUMINANCE_ALPHA
,
0
,
0
,
512
,
512
,
0
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest copyTexImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_FRAMEBUFFER_OPERATION
);
//deleteContext();
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1210
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1210
* @tc.name webgl_test_disable_40
* @tc.name webgl_test_disable_40
...
@@ -998,21 +981,6 @@ describe('webgl1Test', function() {
...
@@ -998,21 +981,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1240
* @tc.name testRenderbufferStorageMultisample_1
* @tc.desc Test renderbufferStorageMultisample.
*/
it
(
'
testRenderbufferStorageMultisample_1
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testRenderbufferStorageMultisample test start ...66
'
);
gl2
.
renderbufferStorageMultisample
(
gl
.
RENDERBUFFER
,
4
,
gl
.
DEPTH_COMPONENT16
,
256
,
256
);
const
renderbufferStorageMultisampleError
=
gl
.
getError
();
console
.
info
(
"
renderbufferStorageMultisampleError:
"
+
renderbufferStorageMultisampleError
);
expect
(
renderbufferStorageMultisampleError
).
assertEqual
(
0
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1241
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1241
* @tc.name testRenderbufferStorageMultisample_2
* @tc.name testRenderbufferStorageMultisample_2
...
@@ -1073,21 +1041,6 @@ describe('webgl1Test', function() {
...
@@ -1073,21 +1041,6 @@ describe('webgl1Test', function() {
done
();
done
();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1245
* @tc.name testRenderbufferStorageMultisample_6
* @tc.desc Test renderbufferStorageMultisample.
*/
it
(
'
testRenderbufferStorageMultisample_6
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testRenderbufferStorageMultisample test start ...66
'
);
gl2
.
renderbufferStorageMultisample
(
gl
.
RENDERBUFFER
,
4
,
gl
.
STENCIL_INDEX8
,
256
,
256
);
const
renderbufferStorageMultisampleError
=
gl
.
getError
();
console
.
info
(
"
renderbufferStorageMultisampleError:
"
+
renderbufferStorageMultisampleError
);
expect
(
renderbufferStorageMultisampleError
).
assertEqual
(
0
);
done
();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1246
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1246
* @tc.name testTransformFeedbackVaryings_7
* @tc.name testTransformFeedbackVaryings_7
...
@@ -2102,29 +2055,6 @@ describe('webgl1Test', function() {
...
@@ -2102,29 +2055,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1297
* @tc.name testGetFramebufferAttachmentParameter3_7
* @tc.desc Test getFramebufferAttachmentParameter.
*/
it
(
'
testGetFramebufferAttachmentParameter3_7
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getFramebufferAttachmentParameter test start ...
'
+
JSON
.
stringify
(
gl
));
const
renderBuffer
=
gl
.
createRenderbuffer
();
gl
.
bindRenderbuffer
(
gl
.
RENDERBUFFER
,
renderBuffer
);
gl
.
framebufferRenderbuffer
(
gl
.
FRAMEBUFFER
,
gl
.
COLOR_ATTACHMENT0
,
gl
.
RENDERBUFFER
,
renderBuffer
);
const
framebuffer
=
gl
.
getFramebufferAttachmentParameter
(
gl
.
FRAMEBUFFER
,
gl
.
DEPTH_STENCIL_ATTACHMENT
,
gl
.
FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
);
console
.
info
(
'
Framebuffer
'
+
framebuffer
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
jsWebGL getFramebufferAttachmentParameter errorCode:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
0
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1298
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1298
* @tc.name testGetFramebufferAttachmentParameter3_8
* @tc.name testGetFramebufferAttachmentParameter3_8
...
...
graphic/webGL/src/main/js/default/test/WebGL.test14.js
浏览文件 @
aa2988b9
...
@@ -386,30 +386,6 @@ describe('webgl1Test', function() {
...
@@ -386,30 +386,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1305
* @tc.name testGetFramebufferAttachmentParameter3_15
* @tc.desc Test getFramebufferAttachmentParameter.
*/
it
(
'
testGetFramebufferAttachmentParameter3_15
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL getFramebufferAttachmentParameter test start ...
'
+
JSON
.
stringify
(
gl
));
const
renderBuffer
=
gl
.
createRenderbuffer
();
gl
.
bindRenderbuffer
(
gl
.
RENDERBUFFER
,
renderBuffer
);
gl
.
framebufferRenderbuffer
(
gl
.
FRAMEBUFFER
,
gl
.
COLOR_ATTACHMENT0
,
gl
.
RENDERBUFFER
,
renderBuffer
);
const
framebuffer
=
gl
.
getFramebufferAttachmentParameter
(
gl
.
FRAMEBUFFER
,
gl
.
DEPTH_STENCIL_ATTACHMENT
,
gl2
.
FRAMEBUFFER_DEFAULT
);
console
.
info
(
'
Framebuffer
'
+
framebuffer
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
jsWebGL getFramebufferAttachmentParameter errorCode:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
0
);
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1306
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1306
* @tc.name webgl_test_checkFramebufferStatus2_1
* @tc.name webgl_test_checkFramebufferStatus2_1
...
@@ -934,112 +910,6 @@ describe('webgl1Test', function() {
...
@@ -934,112 +910,6 @@ describe('webgl1Test', function() {
done
();
done
();
});
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1333
* @tc.name testRangeMin
* @tc.desc Test RangeMin.
*/
it
(
'
testRangeMin
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
jsWebGL testRangeMin test start
'
);
gl
.
getShaderPrecisionFormat
(
gl
.
VERTEX_SHADER
,
gl
.
MEDIUM_FLOAT
).
rangeMin
;
gl
.
getShaderPrecisionFormat
(
gl
.
FRAGMENT_SHADER
,
gl
.
LOW_INT
).
rangeMin
;
const
min
=
gl
.
getShaderPrecisionFormat
(
gl
.
FRAGMENT_SHADER
,
gl
.
LOW_INT
).
rangeMin
;
const
max
=
gl
.
getShaderPrecisionFormat
(
gl
.
VERTEX_SHADER
,
gl
.
MEDIUM_FLOAT
).
rangeMax
;
expect
(
min
).
assertEqual
(
24
);
expect
(
max
).
assertEqual
(
127
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1334
* @tc.name testAttributeBae
* @tc.desc Test AttributeBae.
*/
it
(
'
testAttributeBae
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
jsWebGL testAttributeBae test start
'
);
var
frameBuffer
=
gl
.
createBuffer
();
gl
.
bindBuffer
(
gl
.
FRAMEBUFFER
,
frameBuffer
);
const
framebufferParameter
=
gl
.
getParameter
(
gl
.
FRAMEBUFFER_BINDING
);
const
isFramebuffer
=
gl
.
isFramebuffer
(
framebufferParameter
);
expect
(
isFamebuffer
).
assertEqual
(
true
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1335
* @tc.name testTypeBase
* @tc.desc Test TypeBase.
*/
it
(
'
testTypeBase
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
jsWebGL testTypeBasetest start
'
);
const
progamObj
=
globalFunction
();
const
info
=
gl
.
getActiveAttrib
(
programObj
,
0
);
info
.
size
=
123
;
info
.
name
=
'
name
'
;
info
.
type
=
Number
;
const
size
=
info
.
size
;
const
name
=
info
.
name
;
const
type
=
info
.
type
;
expect
(
size
).
assertEqual
(
info
.
size
);
expect
(
name
).
assertEqual
(
info
.
name
);
expect
(
type
).
assertEqual
(
info
.
type
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1336
* @tc.name testWebGLTypeBase
* @tc.desc Test WebGLTypeBase.
*/
it
(
'
testWebGLTypeBase
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
jsWebGL testWebGLTypeBase test start
'
);
var
x
=
1
;
expect
(
x
).
assertEqual
(
gl
.
ONE
);
var
x1
=
0x8892
;
expect
(
x1
).
assertEqual
(
gl
.
ARRAY_BUFFER
);
var
x2
=
0x0405
;
expect
(
x2
).
assertEqual
(
gl
.
BACK
);
var
x3
=
0
;
expect
(
x3
).
assertEqual
(
gl
.
NO_ERROR
);
var
x4
=
0x0502
;
expect
(
x4
).
assertEqual
(
gl
.
INVALID_OPERATION
);
var
x5
=
0x80AA
;
expect
(
x5
).
assertEqual
(
gl
.
SAMPLE_COVERAGE_VALUE
);
var
x6
=
0x80AB
;
expect
(
x6
).
assertEqual
(
gl
.
SAMPLE_COVERAGE_INVERT
);
var
x7
=
0x1400
;
expect
(
x7
).
assertEqual
(
gl
.
BYTE
);
var
x8
=
0x1404
;
expect
(
x8
).
assertEqual
(
gl
.
INT
);
var
x9
=
0x1406
;
expect
(
x9
).
assertEqual
(
gl
.
FLOAT
);
var
x10
=
0x1907
;
expect
(
x10
).
assertEqual
(
gl
.
RGB
);
var
x11
=
0x8B89
;
expect
(
x11
).
assertEqual
(
gl
.
ACTIVE_ATTRIBUTES
);
var
x12
=
0x0DE1
;
expect
(
x12
).
assertEqual
(
gl
.
TEXTURE_2D
);
var
x13
=
0x1702
;
expect
(
x13
).
assertEqual
(
gl
.
TEXTURE
);
var
x14
=
0x84C0
;
expect
(
x14
).
assertEqual
(
gl
.
TEXTURE0
);
var
x15
=
0x8D40
;
expect
(
x15
).
assertEqual
(
gl
.
FRAMEBUFFER
);
var
x16
=
0x8D41
;
expect
(
x16
).
assertEqual
(
gl
.
RENDERBUFFER
);
var
x17
=
0x8894
;
expect
(
x17
).
assertEqual
(
gl
.
ARRAY_BUFFER
);
var
x18
=
0
;
expect
(
x18
).
assertEqual
(
gl
.
NONE
);
var
x19
=
0x9242
;
expect
(
x19
).
assertEqual
(
gl
.
CONTEXT_LOST_WEBGL
);
var
x20
=
0x8892
;
expect
(
x20
).
assertEqual
(
gl
.
ARRAY_BUFFER
)
done
();
});
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1337
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1337
* @tc.name testRendingContextBase
* @tc.name testRendingContextBase
...
@@ -1049,48 +919,31 @@ describe('webgl1Test', function() {
...
@@ -1049,48 +919,31 @@ describe('webgl1Test', function() {
console
.
info
(
'
jsWebGL testRendingContextBase test start
'
);
console
.
info
(
'
jsWebGL testRendingContextBase test start
'
);
const
buffer
=
gl
.
createBuffer
();
const
buffer
=
gl
.
createBuffer
();
expect
(
typeof
(
buffer
)).
assertEqual
(
'
object
'
);
expect
(
typeof
(
buffer
)).
assertEqual
(
'
object
'
);
var
x1
=
gl2
.
COLOR
;
var
x1
=
gl2
.
COLOR
;
expect
(
x1
).
assertEqual
(
6144
);
expect
(
x1
).
assertEqual
(
6144
);
var
x2
=
gl2
.
STENCIL
;
var
x2
=
gl2
.
STENCIL
;
expect
(
x2
).
assertEqual
(
6146
);
expect
(
x2
).
assertEqual
(
6146
);
var
x3
=
gl2
.
MIN
;
var
x3
=
gl2
.
MIN
;
expect
(
x3
).
assertEqual
(
32775
);
expect
(
x3
).
assertEqual
(
32775
);
var
x4
=
gl2
.
MAX
;
var
x4
=
gl2
.
MAX
;
expect
(
x4
).
assertEqual
(
32776
);
expect
(
x4
).
assertEqual
(
32776
);
var
x5
=
gl2
.
RG
;
var
x5
=
gl2
.
RG
;
expect
(
x5
).
assertEqual
(
33319
);
expect
(
x5
).
assertEqual
(
33319
);
var
x6
=
gl2
.
SYNC_CONDITION
;
var
x6
=
gl2
.
SYNC_CONDITION
;
expect
(
x6
).
assertEqual
(
37139
);
expect
(
x6
).
assertEqual
(
37139
);
var
x7
=
gl2
.
SYNC_STATUS
;
var
x7
=
gl2
.
SYNC_STATUS
;
expect
(
x7
).
assertEqual
(
37140
);
expect
(
x7
).
assertEqual
(
37140
);
var
x8
=
gl2
.
SYNC_FLAGS
;
var
x8
=
gl2
.
SYNC_FLAGS
;
expect
(
x8
).
assertEqual
(
37141
);
expect
(
x8
).
assertEqual
(
37141
);
done
();
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1338
* @tc.name testAttributeBase
* @tc.desc Test testAttributeBase.
*/
it
(
'
testAttributeBase
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
jsWebGL testAttributeBase test start
'
);
var
attribute
=
gl
.
getContextAttributes
();
expect
(
atttribute
.
desynchronized
).
assertEqual
(
false
);
expect
(
atttribute
.
antialias
).
assertEqual
(
true
);
expect
(
atttribute
.
premultipliedAlpha
).
assertEqual
(
true
);
expect
(
atttribute
.
preserveDrawingBuffer
).
assertEqual
(
false
);
expect
(
atttribute
.
failIfMajorPerformanceCaveat
).
assertEqual
(
false
);
done
()
});
});
})
})
graphic/webGL/src/main/js/default/test/WebGL.test15.js
0 → 100644
浏览文件 @
aa2988b9
此差异已折叠。
点击以展开。
graphic/webGL/src/main/js/default/test/webGL.test.js
浏览文件 @
aa2988b9
...
@@ -14923,81 +14923,6 @@ describe('webgl1Test', function() {
...
@@ -14923,81 +14923,6 @@ describe('webgl1Test', function() {
done();
done();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0691
* @tc.name testTexImage2D_0428
* @tc.desc Test texImage2D.
*/
it('testTexImage2D_0428', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexImage2D_0428 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB8, 512, 512, imgData);
const texImage2DError = gl.getError();
console.info("texImage2DError: " + texImage2DError);
expect(texImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0692
* @tc.name testTexImage2D_0428_01
* @tc.desc Test texImage2D.
*/
it('testTexImage2D_0428_01', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexImage2D_0428_01 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texImage2D(-gl.ONE_MINUS_DST_ALPHA, -0, -gl.RGB8, -512, -512, imgData);
const texImage2DError = gl.getError();
console.info("texImage2DError: " + texImage2DError);
expect(texImage2DError).assertEqual(gl.INVALID_VALUE);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0693
* @tc.name testTexImage2D_0428_02
* @tc.desc Test texImage2D.
*/
it('testTexImage2D_0428_02', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexImage2D_0428_02 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texImage2D(-gl.ONE_MINUS_DST_ALPHA, -0, -gl.RGB8, -gl.ONE_MINUS_DST_ALPHA, -0, imgData);
const texImage2DError = gl.getError();
console.info("texImage2DError: " + texImage2DError);
expect(texImage2DError).assertEqual(gl.INVALID_VALUE);
done();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0694
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0694
* @tc.name testTexSubImage2D_01
* @tc.name testTexSubImage2D_01
...
@@ -15035,81 +14960,6 @@ describe('webgl1Test', function() {
...
@@ -15035,81 +14960,6 @@ describe('webgl1Test', function() {
done();
done();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0696
* @tc.name testTexSubImage2D_1
* @tc.desc Test texSubImage2D.
*/
it('testTexSubImage2D_1', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexSubImage2D_1 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RED, gl2.UNSIGNED_BYTE, imgData);
const ttexSubImage2DError = gl.getError();
console.info("ttexSubImage2DError: " + ttexSubImage2DError);
expect(ttexSubImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0697
* @tc.name testTexSubImage2D_1_01
* @tc.desc Test texSubImage2D.
*/
it('testTexSubImage2D_1_01', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexSubImage2D_1_01 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texSubImage2D(-gl.TEXTURE_2D, -0, -0, -0, -gl.RED, -gl2.UNSIGNED_BYTE, imgData);
const ttexSubImage2DError = gl.getError();
console.info("ttexSubImage2DError: " + ttexSubImage2DError);
expect(ttexSubImage2DError).assertEqual(gl.INVALID_ENUM);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0698
* @tc.desc Test texSubImage2D.
*/
it('testTexSubImage2D_1_02', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexSubImage2D_1_02 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texSubImage2D(gl.TEXTURE_2D, -0, -gl.TEXTURE_2D, -0, -gl.RED, -gl2.UNSIGNED_BYTE,
imgData);
const ttexSubImage2DError = gl.getError();
console.info("ttexSubImage2DError: " + ttexSubImage2DError);
expect(ttexSubImage2DError).assertEqual(gl.INVALID_OPERATION);
done();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0699
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0699
* @tc.name testBlitFramebuffer_01
* @tc.name testBlitFramebuffer_01
...
@@ -19279,156 +19129,6 @@ describe('webgl1Test', function() {
...
@@ -19279,156 +19129,6 @@ describe('webgl1Test', function() {
done();
done();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0905
* @tc.name testTexImage2D_0428_01
* @tc.desc Test texImage2D.
*/
it('testTexImage2D_0428_01', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexImage2D_0428_01 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB8, 512, 512, imgData);
const texImage2DError = gl.getError();
console.info("texImage2DError: " + texImage2DError);
expect(texImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0906
* @tc.name testTexImage2D_0428_02
* @tc.desc Test texImage2D.
*/
it('testTexImage2D_0428_02', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexImage2D_0428_02 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB8, 512, 512, imgData);
const texImage2DError = gl.getError();
console.info("texImage2DError: " + texImage2DError);
expect(texImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0907
* @tc.name testTexImage2D_0428_03
* @tc.desc Test texImage2D.
*/
it('testTexImage2D_0428_03', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexImage2D_0428_03 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB8, 512, 512, imgData);
const texImage2DError = gl.getError();
console.info("texImage2DError: " + texImage2DError);
expect(texImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0908
* @tc.name testTexImage2D_0428_04
* @tc.desc Test texImage2D.
*/
it('testTexImage2D_0428_04', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexImage2D_0428_04 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB8, 512, 512, imgData);
const texImage2DError = gl.getError();
console.info("texImage2DError: " + texImage2DError);
expect(texImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0909
* @tc.name testTexImage2D_0428_05
* @tc.desc Test texImage2D.
*/
it('testTexImage2D_0428_05', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexImage2D_0428_05 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB8, 512, 512, imgData);
const texImage2DError = gl.getError();
console.info("texImage2DError: " + texImage2DError);
expect(texImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0910
* @tc.name testTexImage2D_0428_06
* @tc.desc Test texImage2D.
*/
it('testTexImage2D_0428_06', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexImage2D_0428_06 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB8, 512, 512, imgData);
const texImage2DError = gl.getError();
console.info("texImage2DError: " + texImage2DError);
expect(texImage2DError).assertEqual(0);
done();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0911
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0911
* @tc.name testTexSubImage2D_1_01
* @tc.name testTexSubImage2D_1_01
...
@@ -19543,164 +19243,6 @@ describe('webgl1Test', function() {
...
@@ -19543,164 +19243,6 @@ describe('webgl1Test', function() {
done();
done();
})
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0917
* @tc.name testTexSubImage2D_1_07
* @tc.desc Test texSubImage2D.
*/
it('testTexSubImage2D_1_07', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexSubImage2D_1_07 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texSubImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, 0, 0, gl.RED, gl2.UNSIGNED_BYTE,
imgData);
const ttexSubImage2DError = gl.getError();
console.info("ttexSubImage2DError: " + ttexSubImage2DError);
expect(ttexSubImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0918
* @tc.name testTexSubImage2D_1_08
* @tc.desc Test texSubImage2D.
*/
it('testTexSubImage2D_1_08', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexSubImage2D_1_08 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texSubImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, 0, 0, gl.RED, gl2.UNSIGNED_BYTE,
imgData);
const ttexSubImage2DError = gl.getError();
console.info("ttexSubImage2DError: " + ttexSubImage2DError);
expect(ttexSubImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0919
* @tc.name testTexSubImage2D_1_09
* @tc.desc Test texSubImage2D.
*/
it('testTexSubImage2D_1_09', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexSubImage2D_1_09 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texSubImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, 0, 0, gl.RED, gl2.UNSIGNED_BYTE,
imgData);
const ttexSubImage2DError = gl.getError();
console.info("ttexSubImage2DError: " + ttexSubImage2DError);
expect(ttexSubImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0920
* @tc.name testTexSubImage2D_1_10
* @tc.desc Test texSubImage2D.
*/
it('testTexSubImage2D_1_10', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexSubImage2D_1_10 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texSubImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, 0, 0, gl.RED, gl2.UNSIGNED_BYTE,
imgData);
const ttexSubImage2DError = gl.getError();
console.info("ttexSubImage2DError: " + ttexSubImage2DError);
expect(ttexSubImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0921
* @tc.name testTexSubImage2D_1_11
* @tc.desc Test texSubImage2D.
*/
it('testTexSubImage2D_1_11', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexSubImage2D_1_11 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texSubImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, 0, 0, gl.RED, gl2.UNSIGNED_BYTE,
imgData);
const ttexSubImage2DError = gl.getError();
console.info("ttexSubImage2DError: " + ttexSubImage2DError);
expect(ttexSubImage2DError).assertEqual(0);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0922
* @tc.name testTexSubImage2D_1_12
* @tc.desc Test texSubImage2D.
*/
it('testTexSubImage2D_1_12', 0, async function(done) {
//initContext();
console.info('jsWebGL testTexSubImage2D_1_12 test start ...66');
let canvas11 = obj.$refs.canvas1;
var offCanvas2 = canvas11.getContext("2d");
var imgData = offCanvas2.createImageData(300, 500);
console.info("webgl# loc success length:" + imgData.data.length);
for (var i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 0] = 0;
imgData.data[i + 1] = 0;
imgData.data[i + 2] = 255;
imgData.data[i + 3] = 255;
}
gl.texSubImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, 0, 0, gl.RED, gl2.UNSIGNED_BYTE,
imgData);
const ttexSubImage2DError = gl.getError();
console.info("ttexSubImage2DError: " + ttexSubImage2DError);
expect(ttexSubImage2DError).assertEqual(0);
done();
})
/**
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0923
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0923
* @tc.name testCopyBufferSubData_1_01
* @tc.name testCopyBufferSubData_1_01
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录