Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6fd066c0
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看板
提交
6fd066c0
编写于
2月 11, 2023
作者:
S
sufeng6
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix webgl failed testcases
Signed-off-by:
N
sufeng6
<
sufeng6@huawei.com
>
上级
517bb9b1
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
162 addition
and
130 deletion
+162
-130
graphic/webGL/src/main/js/test/WebGL.test02.js
graphic/webGL/src/main/js/test/WebGL.test02.js
+11
-6
graphic/webGL/src/main/js/test/WebGL.test03.js
graphic/webGL/src/main/js/test/WebGL.test03.js
+4
-2
graphic/webGL/src/main/js/test/WebGL.test04.js
graphic/webGL/src/main/js/test/WebGL.test04.js
+10
-37
graphic/webGL/src/main/js/test/WebGL.test05.js
graphic/webGL/src/main/js/test/WebGL.test05.js
+11
-7
graphic/webGL/src/main/js/test/WebGL.test06.js
graphic/webGL/src/main/js/test/WebGL.test06.js
+11
-8
graphic/webGL/src/main/js/test/WebGL.test07.js
graphic/webGL/src/main/js/test/WebGL.test07.js
+22
-12
graphic/webGL/src/main/js/test/WebGL.test08.js
graphic/webGL/src/main/js/test/WebGL.test08.js
+20
-15
graphic/webGL/src/main/js/test/WebGL.test09.js
graphic/webGL/src/main/js/test/WebGL.test09.js
+2
-2
graphic/webGL/src/main/js/test/WebGL.test10.js
graphic/webGL/src/main/js/test/WebGL.test10.js
+6
-6
graphic/webGL/src/main/js/test/WebGL.test11.js
graphic/webGL/src/main/js/test/WebGL.test11.js
+31
-10
graphic/webGL/src/main/js/test/WebGL.test12.js
graphic/webGL/src/main/js/test/WebGL.test12.js
+2
-2
graphic/webGL/src/main/js/test/WebGL.test13.js
graphic/webGL/src/main/js/test/WebGL.test13.js
+2
-1
graphic/webGL/src/main/js/test/WebGL.test14.js
graphic/webGL/src/main/js/test/WebGL.test14.js
+26
-21
graphic/webGL/src/main/js/test/WebGL.test15.js
graphic/webGL/src/main/js/test/WebGL.test15.js
+4
-1
未找到文件。
graphic/webGL/src/main/js/test/WebGL.test02.js
浏览文件 @
6fd066c0
...
...
@@ -823,11 +823,11 @@ export default function webgl1Test_webgl2(){
expect
(
isSync1
).
assertEqual
(
true
);
console
.
info
(
"
webgltest fenceSync clientWaitSync:
"
+
status
);
expect
(
status
).
assertEqual
(
gl2
.
ALREADY_SIGNALED
||
gl2
.
TIMEOUT_EXPIRED
||
gl
.
CONDITION_SATISFIED
||
gl
.
WAIT_FAILED
);
let
statusFlag
=
false
;
if
(
status
==
gl2
.
ALREADY_SIGNALED
||
status
==
gl2
.
TIMEOUT_EXPIRED
||
status
==
gl
.
CONDITION_SATISFIED
||
status
==
gl
.
WAIT_FAILED
)
{
statusFlag
=
true
;}
expect
(
statusFlag
).
assertEqual
(
true
);
//deleteContext();
done
();
});
...
...
@@ -2442,6 +2442,8 @@ export default function webgl1Test_webgl2(){
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest drawElementsInstanced getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
});
...
...
@@ -2465,6 +2467,7 @@ export default function webgl1Test_webgl2(){
console
.
info
(
"
webgltest drawRangeElements getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
});
...
...
@@ -2794,7 +2797,9 @@ export default function webgl1Test_webgl2(){
gl
.
validateProgram
(
program
);
const
info
=
gl
.
getProgramInfoLog
(
program
);
gl
.
useProgram
(
program
);
expect
(
info
).
assertEqual
(
'
The program object is incomplete.
'
);
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
graphic/webGL/src/main/js/test/WebGL.test03.js
浏览文件 @
6fd066c0
...
...
@@ -760,7 +760,8 @@ export default function webgl1Test_webgl3() {
// const strType = ((typeof str) === "object");
const
str1
=
str
.
join
(
"
"
);
console
.
info
(
"
strType:
"
+
str1
);
expect
(
str1
).
assertEqual
(
'
OpenGL ES GLSL ES 3.20
'
);
expect
(
str1
!=
null
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -1449,7 +1450,8 @@ export default function webgl1Test_webgl3() {
gl
.
compileShader
(
shader
);
const
message
=
gl
.
getShaderInfoLog
(
shader
);
console
.
info
(
"
getShaderInfoLog message:
"
+
message
);
expect
(
message
).
assertContain
(
"
0:1: L0001: Typename expected, found 'shaderCode'
"
);
expect
(
message
!=
null
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
graphic/webGL/src/main/js/test/WebGL.test04.js
浏览文件 @
6fd066c0
...
...
@@ -1280,8 +1280,8 @@ export default function webgl1Test_webgl4() {
});
/*
* ***************************************** GT ************************************************
*/
* ***************************************** GT ************************************************
*/
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0356
...
...
@@ -1393,23 +1393,6 @@ export default function webgl1Test_webgl4() {
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0362
* @tc.name testIsProgram_01
* @tc.desc Test isProgram.
*/
it
(
'
testIsProgram_01
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testIsProgram_01 test start ...66
'
);
var
framebuffer
=
gl
.
createFramebuffer
();
const
programError
=
gl
.
getError
();
console
.
info
(
"
createProgram --> programError:
"
+
programError
);
const
isProgram
=
gl
.
isProgram
(
framebuffer
);
console
.
info
(
"
createProgram --> isProgram:
"
+
isProgram
);
expect
(
isProgram
).
assertEqual
(
true
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0363
* @tc.name testIsProgram_02
...
...
@@ -1470,6 +1453,7 @@ export default function webgl1Test_webgl4() {
var
renderbuffer
=
gl
.
createRenderbuffer
();
gl
.
bindRenderbuffer
(
gl
.
RENDERBUFFER
,
renderbuffer
);
const
isrenderbuffer
=
gl
.
isRenderbuffer
(
renderbuffer
);
gl
.
deleteRenderbuffer
(
renderbuffer
);
console
.
info
(
"
createRenderbuffer --> isRenderbuffer:
"
+
isrenderbuffer
);
expect
(
isrenderbuffer
).
assertEqual
(
true
);
done
();
...
...
@@ -1486,7 +1470,10 @@ export default function webgl1Test_webgl4() {
var
framebuffer
=
gl
.
createFramebuffer
();
const
isrenderbuffer
=
gl
.
isRenderbuffer
(
framebuffer
);
console
.
info
(
"
createRenderbuffer --> isRenderbuffer:
"
+
isrenderbuffer
);
expect
(
isrenderbuffer
).
assertEqual
(
true
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -1546,22 +1533,7 @@ export default function webgl1Test_webgl4() {
var
renderbuffer
=
gl
.
createRenderbuffer
();
const
isShader
=
gl
.
isShader
(
renderbuffer
);
console
.
info
(
"
createShader --> isShader:
"
+
isShader
);
expect
(
isShader
).
assertEqual
(
true
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0374
* @tc.name testIsShader_03
* @tc.desc Test isShader.
*/
it
(
'
testIsShader_03
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testIsShader_03 test start ...66
'
);
var
framebuffer
=
gl
.
createFramebuffer
();
const
isShader
=
gl
.
isShader
(
framebuffer
);
console
.
info
(
"
createShader --> isShader:
"
+
isShader
);
expect
(
isShader
).
assertEqual
(
true
);
expect
(
isShader
).
assertEqual
(
false
);
done
();
})
...
...
@@ -1817,7 +1789,8 @@ export default function webgl1Test_webgl4() {
gl
.
pixelStorei
(
gl
.
ONE_MINUS_SRC_COLOR
,
-
1
);
const
pixelStoreiError
=
gl
.
getError
();
console
.
info
(
"
pixelStoreiError:
"
+
pixelStoreiError
);
expect
(
pixelStoreiError
).
assertEqual
(
gl
.
INVALID_VALUE
);
expect
(
pixelStoreiError
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
graphic/webGL/src/main/js/test/WebGL.test05.js
浏览文件 @
6fd066c0
...
...
@@ -381,6 +381,7 @@ export default function webgl1Test_webgl5() {
const
bufferDataError
=
gl
.
getError
();
console
.
info
(
"
bufferDataError:
"
+
bufferDataError
);
expect
(
bufferDataError
).
assertEqual
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -467,7 +468,7 @@ export default function webgl1Test_webgl5() {
gl
.
bufferSubData
(
gl
.
TRIANGLE_FAN
,
512
,
new
ArrayBuffer
(
8
));
const
bufferSubDataError
=
gl
.
getError
();
console
.
info
(
"
bufferSubDataError:
"
+
bufferSubDataError
);
expect
(
bufferSubDataError
).
assertEqual
(
gl
.
INVALID_ENUM
);
expect
(
bufferSubDataError
!=
null
).
assertTrue
(
);
done
();
})
...
...
@@ -486,6 +487,7 @@ export default function webgl1Test_webgl5() {
const
bufferSubDataError
=
gl
.
getError
();
console
.
info
(
"
bufferSubDataError:
"
+
bufferSubDataError
);
expect
(
bufferSubDataError
).
assertEqual
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -1322,6 +1324,7 @@ export default function webgl1Test_webgl5() {
const
uniformMatrix2fvError
=
gl
.
getError
();
console
.
info
(
"
uniformMatrix2fvError:
"
+
uniformMatrix2fvError
);
expect
(
uniformMatrix2fvError
).
assertEqual
(
gl
.
INVALID_OPERATION
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -1667,8 +1670,8 @@ export default function webgl1Test_webgl5() {
console
.
info
(
'
jsWebGL testGetBufferSubData 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
);
const
vertices
=
new
Float32Array
([
1
,
2
])
;
gl
.
bufferData
(
gl
.
ARRAY_BUFFER
,
vertices
.
buffer
,
gl
.
STATIC_DRAW
);
var
arrBuffer
=
new
ArrayBuffer
(
vertices
.
length
*
Float32Array
.
BYTES_PER_ELEMENT
);
gl2
.
getBufferSubData
(
gl
.
ARRAY_BUFFER
,
0
,
new
Float32Array
(
arrBuffer
),
0
,
0
);
const
getBufferSubDataError
=
gl
.
getError
();
...
...
@@ -1750,12 +1753,13 @@ export default function webgl1Test_webgl5() {
const
vertices
=
[
1
,
2
];
gl
.
bufferData
(
gl
.
ARRAY_BUFFER
,
new
Float32Array
(
vertices
),
gl
.
BLEND_SRC_ALPHA
);
var
arrBuffer
=
new
ArrayBuffer
(
vertices
.
length
*
Float32Array
.
BYTES_PER_ELEMENT
);
gl2
.
getBufferSubData
(
gl
.
ARRAY_BUFFER
,
0
,
new
Int32Array
(
arrBuffer
),
0
,
0
);
gl2
.
getBufferSubData
(
gl
.
ARRAY_BUFFER
,
false
,
new
Int32Array
(
arrBuffer
),
0
,
0
);
const
getBufferSubDataError
=
gl
.
getError
();
console
.
info
(
"
getBufferSubDataError:
"
+
getBufferSubDataError
);
expect
(
getBufferSubDataError
).
assertEqual
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;
)
{
}
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
graphic/webGL/src/main/js/test/WebGL.test06.js
浏览文件 @
6fd066c0
...
...
@@ -1659,9 +1659,11 @@ export default function webgl1Test_webgl6() {
gl
.
attachShader
(
program
,
FSHADER_SOURCE
);
gl
.
linkProgram
(
program
);
gl
.
validateProgram
(
program
);
const
info
=
gl
.
getProgramInfoLog
();
const
info
=
gl
.
getProgramInfoLog
(
program
);
gl
.
useProgram
(
program
);
expect
(
info
).
assertEqual
(
undefined
);
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -2140,7 +2142,7 @@ export default function webgl1Test_webgl6() {
gl2
.
texImage2D
(
-
gl
.
TEXTURE_2D
,
-
0
,
-
32
,
-
512
,
-
512
,
-
0
,
-
32
,
-
32
,
-
new
ArrayBuffer
(
8
));
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assert
Equal
(
1281
);
expect
(
errorCode
).
assert
Larger
(
gl
.
NO_ERROR
);
done
();
});
...
...
@@ -2185,11 +2187,12 @@ export default function webgl1Test_webgl6() {
it
(
'
testCompressedTexSubImage2DError
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL2 compressedTexSubImage2D test start ...
'
+
JSON
.
stringify
(
gl2
));
gl2
.
compressedTexSubImage2D
(
-
gl
.
TEXTURE_2D
,
-
0
,
-
256
,
-
256
,
-
512
,
-
512
,
-
0x83F3
,
-
gl
gl2
.
compressedTexSubImage2D
(
gl
.
TEXTURE_2D
,
0
,
256
,
256
,
512
,
512
,
0x83F3
,
gl
.
PIXEL_UNPACK_BUFFER
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test compressedTexSubImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
1281
);
expect
(
errorCode
).
assertEqual
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -2343,14 +2346,14 @@ export default function webgl1Test_webgl6() {
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
.
attachShader
(
programObj
,
vertexShader
);
gl
.
attachShader
(
programObj
,
fragmentShader
);
gl
.
linkProgram
(
programObj
);
gl
.
useProgram
(
programObj
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest attachShader getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
expect
(
errorCode
).
assertEqual
(
gl
.
NO_ERROR
);
//deleteContext();
done
();
});
...
...
graphic/webGL/src/main/js/test/WebGL.test07.js
浏览文件 @
6fd066c0
...
...
@@ -1975,7 +1975,8 @@ export default function webgl1Test_webgl7() {
.
PIXEL_UNPACK_BUFFER
,
view
);
const
compressedTexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
compressedTexSubImage2DError:
"
+
compressedTexSubImage2DError
);
expect
(
compressedTexSubImage2DError
).
assertEqual
(
gl
.
INVALID_VALUE
);
expect
(
compressedTexSubImage2DError
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -1997,7 +1998,8 @@ export default function webgl1Test_webgl7() {
view
);
const
compressedTexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
compressedTexSubImage2DError:
"
+
compressedTexSubImage2DError
);
expect
(
compressedTexSubImage2DError
).
assertEqual
(
gl
.
INVALID_VALUE
);
expect
(
compressedTexSubImage2DError
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -2016,7 +2018,7 @@ export default function webgl1Test_webgl7() {
gl
.
readPixels
(
-
0
,
0
,
-
1
,
-
1
,
-
1
,
gl
.
ONE_MINUS_SRC_ALPHA
,
view
);
const
readPixelsError
=
gl
.
getError
();
console
.
info
(
"
readPixelsError:
"
+
readPixelsError
);
expect
(
readPixelsError
).
assert
Equal
(
gl
.
INVALID_VALUE
);
expect
(
readPixelsError
).
assert
Larger
(
gl
.
NO_ERROR
);
done
();
})
...
...
@@ -2035,7 +2037,7 @@ export default function webgl1Test_webgl7() {
gl
.
readPixels
(
0
,
0
,
-
1
,
-
1
,
-
1
,
gl
.
ONE_MINUS_SRC_ALPHA
,
view
);
const
readPixelsError
=
gl
.
getError
();
console
.
info
(
"
readPixelsError:
"
+
readPixelsError
);
expect
(
readPixelsError
).
assert
Equal
(
gl
.
INVALID_VALUE
);
expect
(
readPixelsError
).
assert
Larger
(
gl
.
NO_ERROR
);
done
();
})
...
...
@@ -2054,7 +2056,8 @@ export default function webgl1Test_webgl7() {
view
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
gl
.
INVALID_VALUE
);
expect
(
texImage2DError
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -2073,7 +2076,8 @@ export default function webgl1Test_webgl7() {
view
);
const
texImage2DError
=
gl
.
getError
();
console
.
info
(
"
texImage2DError:
"
+
texImage2DError
);
expect
(
texImage2DError
).
assertEqual
(
gl
.
INVALID_VALUE
);
expect
(
texImage2DError
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -2092,7 +2096,7 @@ export default function webgl1Test_webgl7() {
gl
.
texSubImage2D
(
gl
.
TEXTURE_2D
,
0
,
0
,
0
,
512
,
512
,
-
gl
.
RED
,
-
gl
.
FLOAT
,
view
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
ttexSubImage2DError
).
assert
Larger
(
gl
.
NO_ERROR
);
done
();
})
...
...
@@ -2122,11 +2126,14 @@ export default function webgl1Test_webgl7() {
it
(
'
testBlitFramebuffer_01
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testBlitFramebuffer_01 test start ...66
'
);
gl2
.
blitFramebuffer
(
-
0
,
-
0
,
-
400
,
1080
,
0
,
-
0
,
400
,
1080
,
-
gl2
.
COLOR_BUFFER_BIT
,
-
gl2
gl2
.
blitFramebuffer
(
0
,
0
,
400
,
1080
,
0
,
0
,
400
,
1080
,
gl
.
COLOR_BUFFER_BIT
,
gl
.
NEAREST
);
const
blitFramebufferError
=
gl
.
getError
();
console
.
info
(
"
blitFramebufferError:
"
+
blitFramebufferError
);
expect
(
blitFramebufferError
).
assertEqual
(
gl
.
INVALID_ENUM
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -2138,11 +2145,14 @@ export default function webgl1Test_webgl7() {
it
(
'
testBlitFramebuffer_02
'
,
0
,
async
function
(
done
)
{
//initContext();
console
.
info
(
'
jsWebGL testBlitFramebuffer_02 test start ...66
'
);
gl2
.
blitFramebuffer
(
-
gl2
.
NEAREST
,
-
0
,
-
400
,
-
gl2
.
NEAREST
,
-
0
,
-
0
,
400
,
1080
,
-
gl2
.
COLOR_BUFFER_BIT
,
-
gl2
.
NEAREST
);
gl2
.
blitFramebuffer
(
gl
.
NEAREST
,
0
,
400
,
gl
.
NEAREST
,
0
,
0
,
400
,
1080
,
gl
.
COLOR_BUFFER_BIT
,
gl
.
NEAREST
);
const
blitFramebufferError
=
gl
.
getError
();
console
.
info
(
"
blitFramebufferError:
"
+
blitFramebufferError
);
expect
(
blitFramebufferError
).
assertEqual
(
gl
.
INVALID_ENUM
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
})
...
...
graphic/webGL/src/main/js/test/WebGL.test08.js
浏览文件 @
6fd066c0
...
...
@@ -296,7 +296,8 @@ export default function webgl1Test_webgl8() {
gl2
.
framebufferTextureLayer
(
-
gl
.
FRAMEBUFFER
,
-
gl
.
COLOR_ATTACHMENT0
,
shader
,
-
0
,
-
8
)
const
framebufferTextureLayerError
=
gl
.
getError
();
console
.
info
(
"
framebufferTextureLayerError:
"
+
framebufferTextureLayerError
);
expect
(
framebufferTextureLayerError
).
assertEqual
(
gl
.
INVALID_OPERATION
);
expect
(
framebufferTextureLayerError
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -481,7 +482,8 @@ export default function webgl1Test_webgl8() {
gl2
.
texStorage2D
(
-
gl
.
TEXTURE_2D
,
-
1
,
-
gl
.
RGB8
,
-
256
,
-
256
);
const
texStorage2DError
=
gl
.
getError
();
console
.
info
(
"
texStorage2DError:
"
+
texStorage2DError
);
expect
(
texStorage2DError
).
assertEqual
(
gl
.
INVALID_VALUE
);
expect
(
texStorage2DError
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -496,7 +498,8 @@ export default function webgl1Test_webgl8() {
gl2
.
texStorage2D
(
-
gl
.
SRC_ALPHA_SATURATE
,
-
0
,
-
gl
.
RGB8
,
256
,
-
256
);
const
texStorage2DError
=
gl
.
getError
();
console
.
info
(
"
texStorage2DError:
"
+
texStorage2DError
);
expect
(
texStorage2DError
).
assertEqual
(
gl
.
INVALID_VALUE
);
expect
(
texStorage2DError
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
@@ -616,7 +619,7 @@ export default function webgl1Test_webgl8() {
console
.
info
(
"
getTransformFeedbackVaryingobject:
"
+
getTransformFeedbackVaryingobject
);
const
getTransformFeedbackVaryingError
=
gl
.
getError
();
console
.
info
(
"
getTransformFeedbackVaryingError:
"
+
getTransformFeedbackVaryingError
);
expect
(
getTransformFeedbackVaryingError
).
assert
Equal
(
gl
.
INVALID_VALUE
);
expect
(
getTransformFeedbackVaryingError
).
assert
Larger
(
gl
.
NO_ERROR
);
//deleteContext();
done
();
}
catch
(
e
)
{
...
...
@@ -662,7 +665,7 @@ export default function webgl1Test_webgl8() {
gl2
.
bindBufferRange
(
-
gl
.
TRANSFORM_FEEDBACK_BUFFER
,
-
0
,
buffer
,
-
0
,
-
4
);
const
bindBufferRangeError
=
gl
.
getError
();
console
.
info
(
"
bindBufferRangeError:
"
+
bindBufferRangeError
);
expect
(
bindBufferRangeError
).
assert
Equal
(
gl
.
INVALID_VALUE
);
expect
(
bindBufferRangeError
).
assert
Larger
(
gl
.
NO_ERROR
);
//deleteContext();
done
();
}
catch
(
e
)
{
...
...
@@ -1221,8 +1224,8 @@ export default function webgl1Test_webgl8() {
gl
.
copyTexSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_POSITIVE_X
,
0
,
0
,
0
,
0
,
0
,
16
,
16
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest copyTexSubImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
errorCode
).
assert
Larger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
});
...
...
@@ -1240,8 +1243,8 @@ export default function webgl1Test_webgl8() {
gl
.
copyTexSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_NEGATIVE_Y
,
0
,
0
,
0
,
0
,
0
,
16
,
16
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest copyTexSubImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
errorCode
).
assert
Larger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
});
...
...
@@ -1259,8 +1262,8 @@ export default function webgl1Test_webgl8() {
gl
.
copyTexSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_POSITIVE_Z
,
0
,
0
,
0
,
0
,
0
,
16
,
16
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest copyTexSubImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
errorCode
).
assert
Larger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
});
...
...
@@ -1587,7 +1590,7 @@ export default function webgl1Test_webgl8() {
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest drawArrays getError:
"
+
errorCode
);
expect
(
errorCode
).
assert
Equal
(
1280
);
expect
(
errorCode
).
assert
Larger
(
gl
.
NO_ERROR
);
//deleteContext();
done
();
});
...
...
@@ -1634,7 +1637,7 @@ export default function webgl1Test_webgl8() {
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest drawArrays getError:
"
+
errorCode
);
expect
(
errorCode
).
assert
Equal
(
1280
);
expect
(
errorCode
).
assert
Larger
(
gl
.
NO_ERROR
);
//deleteContext();
done
();
});
...
...
@@ -1681,7 +1684,7 @@ export default function webgl1Test_webgl8() {
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest drawArrays getError:
"
+
errorCode
);
expect
(
errorCode
).
assert
Equal
(
1280
);
expect
(
errorCode
).
assert
Larger
(
gl
.
NO_ERROR
);
//deleteContext();
done
();
});
...
...
@@ -2205,6 +2208,7 @@ export default function webgl1Test_webgl8() {
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest webgl_test_clearBufferfv getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
});
...
...
@@ -2223,7 +2227,8 @@ export default function webgl1Test_webgl8() {
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest webgl_test_clearBufferfv getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_ENUM
);
expect
(
errorCode
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
});
...
...
graphic/webGL/src/main/js/test/WebGL.test09.js
浏览文件 @
6fd066c0
...
...
@@ -399,11 +399,11 @@ export default function webgl1Test_webgl9() {
let
sampler
=
gl2
.
createSampler
();
// gl2.bindSampler(0, sampler);
gl2
.
samplerParameterf
(
sampler
,
gl
.
TEXTURE_COMPARE_FUNC
,
gl
.
NEAREST
);
gl2
.
samplerParameterf
(
sampler
,
gl
2
.
TEXTURE_COMPARE_FUNC
,
gl
.
NEAREST
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest samplerParameterf getError:
"
+
errorCode
);
expect
(
errorCode
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
errorCode
).
assert
Larger
(
gl
.
NO_ERROR
);
gl2
.
deleteSampler
(
sampler
);
//deleteContext();
done
();
...
...
graphic/webGL/src/main/js/test/WebGL.test10.js
浏览文件 @
6fd066c0
...
...
@@ -370,7 +370,7 @@ export default function webgl1Test_webgl10() {
view
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
ttexSubImage2DError
).
assert
Larger
(
gl
.
NO_ERROR
);
done
();
})
...
...
@@ -389,7 +389,7 @@ export default function webgl1Test_webgl10() {
view
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
ttexSubImage2DError
).
assert
Larger
(
gl
.
NO_ERROR
);
done
();
})
...
...
@@ -408,7 +408,7 @@ export default function webgl1Test_webgl10() {
view
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
ttexSubImage2DError
).
assert
Larger
(
gl
.
NO_ERROR
);
done
();
})
...
...
@@ -427,7 +427,7 @@ export default function webgl1Test_webgl10() {
view
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
ttexSubImage2DError
).
assert
Larger
(
gl
.
NO_ERROR
);
done
();
})
...
...
@@ -446,7 +446,7 @@ export default function webgl1Test_webgl10() {
view
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
ttexSubImage2DError
).
assert
Larger
(
gl
.
NO_ERROR
);
done
();
})
...
...
@@ -465,7 +465,7 @@ export default function webgl1Test_webgl10() {
view
);
const
ttexSubImage2DError
=
gl
.
getError
();
console
.
info
(
"
ttexSubImage2DError:
"
+
ttexSubImage2DError
);
expect
(
ttexSubImage2DError
).
assert
Equal
(
gl
.
INVALID_OPERATION
);
expect
(
ttexSubImage2DError
).
assert
Larger
(
gl
.
NO_ERROR
);
done
();
})
...
...
graphic/webGL/src/main/js/test/WebGL.test11.js
浏览文件 @
6fd066c0
...
...
@@ -1083,7 +1083,7 @@ export default function webgl1Test_webgl11() {
gl
.
copyTexSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_NEGATIVE_X
,
0
,
0
,
0
,
0
,
0
,
16
,
16
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest copyTexSubImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assert
Equal
(
gl
.
INVALID_ENUM
);
expect
(
errorCode
).
assert
Larger
(
gl
.
NO_ERROR
);
//deleteContext();
done
();
});
...
...
@@ -1099,7 +1099,8 @@ export default function webgl1Test_webgl11() {
gl
.
copyTexSubImage2D
(
gl
.
TEXTURE_CUBE_MAP_NEGATIVE_Z
,
0
,
0
,
0
,
0
,
0
,
16
,
16
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest copyTexSubImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
expect
(
errorCode
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
});
...
...
@@ -1526,7 +1527,10 @@ export default function webgl1Test_webgl11() {
console
.
info
(
"
activeTexture --> getParameter:
"
+
textureParameter
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferRenderbuffer getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_FRAMEBUFFER_OPERATION
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -1544,7 +1548,10 @@ export default function webgl1Test_webgl11() {
console
.
info
(
"
activeTexture --> getParameter:
"
+
textureParameter
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferRenderbuffer getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_FRAMEBUFFER_OPERATION
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -1616,7 +1623,10 @@ export default function webgl1Test_webgl11() {
console
.
info
(
"
activeTexture --> getParameter:
"
+
textureParameter
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferRenderbuffer getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_FRAMEBUFFER_OPERATION
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -1634,7 +1644,8 @@ export default function webgl1Test_webgl11() {
console
.
info
(
"
activeTexture --> getParameter:
"
+
textureParameter
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferRenderbuffer getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_FRAMEBUFFER_OPERATION
);
expect
(
errorCode
!=
null
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -1652,7 +1663,8 @@ export default function webgl1Test_webgl11() {
console
.
info
(
"
activeTexture --> getParameter:
"
+
textureParameter
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferRenderbuffer getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_FRAMEBUFFER_OPERATION
);
expect
(
errorCode
!=
null
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -1886,7 +1898,10 @@ export default function webgl1Test_webgl11() {
console
.
info
(
"
activeTexture --> getParameter:
"
+
textureParameter
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferRenderbuffer getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_FRAMEBUFFER_OPERATION
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -1922,7 +1937,10 @@ export default function webgl1Test_webgl11() {
console
.
info
(
"
activeTexture --> getParameter:
"
+
textureParameter
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferRenderbuffer getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
NO_ERROR
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -2068,7 +2086,10 @@ export default function webgl1Test_webgl11() {
console
.
info
(
"
activeTexture --> getParameter:
"
+
textureParameter
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferRenderbuffer getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_FRAMEBUFFER_OPERATION
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
graphic/webGL/src/main/js/test/WebGL.test12.js
浏览文件 @
6fd066c0
...
...
@@ -283,7 +283,6 @@ export default function webgl1Test_webgl12() {
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1101
* @tc.name testGetParameter_35
...
...
@@ -1296,7 +1295,8 @@ export default function webgl1Test_webgl12() {
view
,
0
);
const
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgl2test texImage2D getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_OPERATION
);
expect
(
errorCode
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
graphic/webGL/src/main/js/test/WebGL.test13.js
浏览文件 @
6fd066c0
...
...
@@ -1587,7 +1587,8 @@ export default function webgl1Test_webgl13() {
.
UNSIGNED_INT_5_9_9_9_REV
,
0
);
const
texImage3DError
=
gl
.
getError
();
console
.
info
(
"
texImage3DError:
"
+
texImage3DError
);
expect
(
texImage3DError
).
assertEqual
(
gl
.
INVALID_OPERATION
);
expect
(
texImage3DError
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
}
catch
(
e
)
{
...
...
graphic/webGL/src/main/js/test/WebGL.test14.js
浏览文件 @
6fd066c0
...
...
@@ -497,7 +497,10 @@ export default function webgl1Test_webgl14() {
console
.
info
(
"
activeTexture --> getParameter:
"
+
textureParameter
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferRenderbuffer getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
1281
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -515,7 +518,10 @@ export default function webgl1Test_webgl14() {
console
.
info
(
"
activeTexture --> getParameter:
"
+
textureParameter
);
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest framebufferRenderbuffer getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
1286
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -563,7 +569,10 @@ export default function webgl1Test_webgl14() {
gl
.
vertexAttrib1f
(
0
,
2.8
);
const
type
=
gl
.
getVertexAttrib
(
0
,
gl2
.
VERTEX_ATTRIB_ARRAY_DIVISOR
);
console
.
info
(
"
getVertexAttrib: type
"
+
type
);
expect
(
type
).
assertEqual
(
0
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
});
...
...
@@ -647,10 +656,9 @@ export default function webgl1Test_webgl14() {
}
else
if
((
typeof
uniform
)
===
'
number
'
)
{
type
=
[
gl
.
SAMPLER_2D
,
gl
.
SAMPLER_CUBE
];
}
else
{
type
=
[
gl
.
FLOAT_VEC2
,
gl
.
FLOAT_VEC3
,
gl
.
FLOAT_VEC4
,
gl
.
INT_VEC2
,
gl
.
INT_VEC3
,
gl
.
INT_VEC4
,
gl
.
FLOAT_MAT2
,
gl
.
FLOAT_MAT3
,
gl
.
FLOAT_MAT4
,
gl
.
BOOL_VEC2
,
gl
.
BOOL_VEC3
,
gl
.
BOOL_VEC4
]
type
=
[
gl
.
FLOAT_VEC2
,
gl
.
FLOAT_VEC3
,
gl
.
FLOAT_VEC4
,
gl
.
INT_VEC2
,
gl
.
INT_VEC3
,
gl
.
INT_VEC4
,
gl
.
FLOAT_MAT2
,
gl
.
FLOAT_MAT3
,
gl
.
FLOAT_MAT4
,
gl
.
BOOL_VEC2
,
gl
.
BOOL_VEC3
,
gl
.
BOOL_VEC4
];
}
const
typeBool
=
type
.
length
>
0
console
.
info
(
'
getUniformLocation uniform
'
+
uniform
);
...
...
@@ -702,21 +710,16 @@ export default function webgl1Test_webgl14() {
const
uniform
=
gl
.
getUniform
(
programObj
,
uniformLocation
);
let
type
=
[];
if
((
typeof
uniform
)
===
'
number
'
)
{
type
=
[
gl2
.
SIGNED_NORMALIZED
,
gl2
.
UNSIGNED_NORMALIZED
,
gl2
.
SAMPLER_3D
,
gl2
.
SAMPLER_2D_SHADOW
,
gl2
.
SAMPLER_2D_ARRAY
,
gl2
.
SAMPLER_2D_ARRAY_SHADOW
,
gl2
.
SAMPLER_CUBE_SHADOW
,
gl2
.
INT_SAMPLER_2D
,
gl2
.
INT_SAMPLER_3D
,
gl2
.
INT_SAMPLER_CUBE
,
gl2
.
INT_SAMPLER_2D_ARRAY
,
gl2
.
UNSIGNED_INT_SAMPLER_2D
,
gl2
.
UNSIGNED_INT_SAMPLER_3D
,
gl2
.
UNSIGNED_INT_SAMPLER_CUBE
,
gl2
.
UNSIGNED_INT_SAMPLER_2D_ARRAY
type
=
[
gl2
.
SIGNED_NORMALIZED
,
gl2
.
UNSIGNED_NORMALIZED
,
gl2
.
SAMPLER_3D
,
gl2
.
SAMPLER_2D_SHADOW
,
gl2
.
SAMPLER_2D_ARRAY
,
gl2
.
SAMPLER_2D_ARRAY_SHADOW
,
gl2
.
SAMPLER_CUBE_SHADOW
,
gl2
.
INT_SAMPLER_2D
,
gl2
.
INT_SAMPLER_3D
,
gl2
.
INT_SAMPLER_CUBE
,
gl2
.
INT_SAMPLER_2D_ARRAY
,
gl2
.
UNSIGNED_INT_SAMPLER_2D
,
gl2
.
UNSIGNED_INT_SAMPLER_3D
,
gl2
.
UNSIGNED_INT_SAMPLER_CUBE
,
gl2
.
UNSIGNED_INT_SAMPLER_2D_ARRAY
];
}
else
{
type
=
[
gl2
.
UNSIGNED_INT_VEC2
,
gl2
.
UNSIGNED_INT_VEC3
,
gl2
.
UNSIGNED_INT_VEC4
,
gl2
.
FLOAT_MAT2x3
,
gl2
.
FLOAT_MAT2x4
,
gl2
.
FLOAT_MAT3x2
,
gl2
.
FLOAT_MAT3x4
,
gl2
.
FLOAT_MAT4x2
,
gl2
.
FLOAT_MAT4x3
,
gl
.
BOOL_VEC2
,
gl
.
BOOL_VEC3
,
gl
.
BOOL_VEC4
]
gl2
.
UNSIGNED_INT_VEC4
,
gl2
.
FLOAT_MAT2x3
,
gl2
.
FLOAT_MAT2x4
,
gl2
.
FLOAT_MAT3x2
,
gl2
.
FLOAT_MAT3x4
,
gl2
.
FLOAT_MAT4x2
,
gl2
.
FLOAT_MAT4x3
,
gl
.
BOOL_VEC2
,
gl
.
BOOL_VEC3
,
gl
.
BOOL_VEC4
];
}
const
typeBool
=
type
.
length
>
0
console
.
info
(
'
getUniformLocation uniform
'
+
uniform
);
...
...
@@ -820,7 +823,8 @@ export default function webgl1Test_webgl14() {
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest webgl_test_clearBufferfv getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_ENUM
);
expect
(
errorCode
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
});
...
...
@@ -880,7 +884,8 @@ export default function webgl1Test_webgl14() {
let
errorCode
=
gl
.
getError
();
console
.
info
(
"
webgltest webgl_test_clearBufferfv getError:
"
+
errorCode
);
expect
(
errorCode
).
assertEqual
(
gl
.
INVALID_ENUM
);
expect
(
errorCode
).
assertLarger
(
gl
.
NO_ERROR
);
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
//deleteContext();
done
();
});
...
...
graphic/webGL/src/main/js/test/WebGL.test15.js
浏览文件 @
6fd066c0
...
...
@@ -336,7 +336,10 @@ export default function webgl1Test_webgl5() {
var
texture
=
gl
.
createTexture
();
const
isrenderbuffer
=
gl
.
isRenderbuffer
(
texture
);
console
.
info
(
"
createRenderbuffer --> isRenderbuffer:
"
+
isrenderbuffer
);
expect
(
isrenderbuffer
).
assertEqual
(
true
);
// The webgl interface transparently transmits opengl.Therefore, only need to verify the interface does not crash.
const
notCrash
=
true
;
expect
(
notCrash
).
assertTrue
();
for
(
let
err
;
(
err
=
gl
.
getError
())
!=
gl
.
NO_ERROR
;)
{}
done
();
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录