Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
25ba27c6
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
25ba27c6
编写于
7月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4486 WebGL测试套用例覆盖
Merge pull request !4486 from zleoyu/webgl-Release
上级
36b1d4e4
3d90a9a0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
170 addition
and
12 deletion
+170
-12
graphic/webGL/src/main/js/default/test/WebGL.test01.js
graphic/webGL/src/main/js/default/test/WebGL.test01.js
+11
-5
graphic/webGL/src/main/js/default/test/WebGL.test14.js
graphic/webGL/src/main/js/default/test/WebGL.test14.js
+3
-0
graphic/webGL/src/main/js/default/test/WebGL.test15.js
graphic/webGL/src/main/js/default/test/WebGL.test15.js
+134
-0
graphic/webGL/src/main/js/default/test/webGL.test.js
graphic/webGL/src/main/js/default/test/webGL.test.js
+22
-7
未找到文件。
graphic/webGL/src/main/js/default/test/WebGL.test01.js
浏览文件 @
25ba27c6
...
...
@@ -248,14 +248,14 @@ describe('webgl1Test_webgl2', function() {
function
initContext
()
{
console
.
info
(
'
initContext start
'
);
// 获取canvas元素
const
el
=
global
.
el
;
const
el
2
=
global
.
el2
;
const
canvas
=
global
.
el
;
const
canvas
2
=
global
.
el2
;
// 获取webgl上下文
gl
=
el
.
getContext
(
'
webgl
'
);
gl
=
canvas
.
getContext
(
'
webgl
'
);
if
(
!
gl
)
{
console
.
log
(
'
webgltest Failed to get the rendering context for WebGL
'
);
}
gl2
=
el
2
.
getContext
(
'
webgl2
'
);
gl2
=
canvas
2
.
getContext
(
'
webgl2
'
);
if
(
!
gl
)
{
console
.
log
(
'
webgltest Failed to get the rendering context for WebGL2
'
);
}
...
...
@@ -2004,8 +2004,14 @@ describe('webgl1Test_webgl2', function() {
gl
.
STATIC_DRAW
);
var
viewPortParameter
=
gl
.
getParameter
(
gl
.
MAX_VIEWPORT_DIMS
);
var
maxViewPortDimsParameter
=
gl
.
getParameter
(
gl
.
MAX_VIEWPORT_DIMS
);
console
.
log
(
'
maxViewPortDimsParameter:
'
+
maxViewPortDimsParameter
);
var
viewPortParameter
=
gl
.
getParameter
(
gl
.
VIEWPORT
);
console
.
log
(
'
viewPortParameter:
'
+
viewPortParameter
);
var
boolParameter
=
gl
.
getParameter
(
gl
.
BOOL
);
console
.
log
(
'
boolParameter:
'
+
boolParameter
);
var
SamplerCubeParameter
=
gl
.
getParameter
(
gl
.
SAMPLER_CUBE
);
console
.
log
(
'
SamplerCubeParameter:
'
+
SamplerCubeParameter
);
const
isContextLostValue
=
gl
.
isContextLost
();
console
.
info
(
"
isContextLostValue:
"
+
isContextLostValue
);
...
...
graphic/webGL/src/main/js/default/test/WebGL.test14.js
浏览文件 @
25ba27c6
...
...
@@ -947,6 +947,9 @@ describe('webgl1Test_webgl15', function() {
var
x8
=
gl2
.
SYNC_FLAGS
;
expect
(
x8
).
assertEqual
(
37141
);
var
x9
=
gl2
.
OBJECT_TYPE
;
expect
(
x9
).
assertEqual
(
37138
);
done
();
});
})
graphic/webGL/src/main/js/default/test/WebGL.test15.js
浏览文件 @
25ba27c6
...
...
@@ -380,4 +380,138 @@ describe('webgl1Test_webgl16', function() {
expect
(
stencilMaskSeparateParameter
).
assertEqual
(
110101
);
done
();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1338
* @tc.name webgl_test_webglContextAttributes
* @tc.desc Test webglContextAttributes.
*/
it
(
'
webgl_test_webglContextAttributes_0
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
webgltest into webglContextAttributes
"
);
const
ContextAttributesValue
=
gl
.
getContextAttributes
();
ContextAttributesValue
.
alpha
=
true
;
const
alphaValue
=
ContextAttributesValue
.
alpha
;
console
.
info
(
"
webgltest webglContextAttributes:
"
+
alphaValue
);
expect
(
alphaValue
).
assertEqual
(
true
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1339
* @tc.name webgl_test_webglContextAttributes
* @tc.desc Test webglContextAttributes.
*/
it
(
'
webgl_test_webglContextAttributes_1
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
webgltest into webglContextAttributes_1
"
);
const
ContextAttributesValue
=
gl
.
getContextAttributes
();
ContextAttributesValue
.
antialias
=
true
;
const
antialiasValue
=
ContextAttributesValue
.
antialias
;
console
.
info
(
"
webgltest webglContextAttributes_1:
"
+
antialiasValue
);
expect
(
antialiasValue
).
assertEqual
(
true
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1341
* @tc.name webgl_test_webglContextAttributes
* @tc.desc Test webglContextAttributes.
*/
it
(
'
webgl_test_webglContextAttributes_2
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
webgltest into webglContextAttributes_2
"
);
const
ContextAttributesValue
=
gl
.
getContextAttributes
();
ContextAttributesValue
.
depth
=
true
;
const
depthValue
=
ContextAttributesValue
.
depth
;
console
.
info
(
"
webgltest webglContextAttributes_2:
"
+
depthValue
);
expect
(
depthValue
).
assertEqual
(
true
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1342
* @tc.name webgl_test_webglContextAttributes
* @tc.desc Test webglContextAttributes.
*/
it
(
'
webgl_test_webglContextAttributes_3
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
webgltest into webglContextAttributes_3
"
);
const
ContextAttributesValue
=
gl
.
getContextAttributes
();
ContextAttributesValue
.
failIfMajorPerformanceCaveat
=
false
;
const
failIfMajorPerformanceCaveatValue
=
ContextAttributesValue
.
failIfMajorPerformanceCaveat
;
console
.
info
(
"
webgltest webglContextAttributes_3:
"
+
failIfMajorPerformanceCaveatValue
);
expect
(
failIfMajorPerformanceCaveatValue
).
assertEqual
(
false
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1343
* @tc.name webgl_test_webglContextAttributes
* @tc.desc Test webglContextAttributes.
*/
it
(
'
webgl_test_webglContextAttributes_4
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
webgltest into webglContextAttributes_4
"
);
const
ContextAttributesValue
=
gl
.
getContextAttributes
();
ContextAttributesValue
.
desynchronized
=
false
;
const
desynchronizedValue
=
ContextAttributesValue
.
desynchronized
;
console
.
info
(
"
webgltest webglContextAttributes_4:
"
+
desynchronizedValue
);
expect
(
desynchronizedValue
).
assertEqual
(
false
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1344
* @tc.name webgl_test_webglContextAttributes
* @tc.desc Test webglContextAttributes.
*/
it
(
'
webgl_test_webglContextAttributes_5
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
webgltest into webglContextAttributes_5
"
);
const
ContextAttributesValue
=
gl
.
getContextAttributes
();
const
powerPreferenceValue
=
ContextAttributesValue
.
powerPreference
;
console
.
info
(
"
webgltest webglContextAttributes_5:
"
+
powerPreferenceValue
);
expect
(
powerPreferenceValue
).
assertEqual
(
"
default
"
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1345
* @tc.name webgl_test_webglContextAttributes
* @tc.desc Test webglContextAttributes.
*/
it
(
'
webgl_test_webglContextAttributes_6
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
webgltest into webglContextAttributes_6
"
);
const
ContextAttributesValue
=
gl
.
getContextAttributes
();
ContextAttributesValue
.
premultipliedAlpha
=
true
;
const
premultipliedAlphaValue
=
ContextAttributesValue
.
premultipliedAlpha
;
console
.
info
(
"
webgltest webglContextAttributes_6:
"
+
premultipliedAlphaValue
);
expect
(
premultipliedAlphaValue
).
assertEqual
(
true
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1346
* @tc.name webgl_test_webglContextAttributes
* @tc.desc Test webglContextAttributes.
*/
it
(
'
webgl_test_webglContextAttributes_7
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
webgltest into webglContextAttributes_7
"
);
const
ContextAttributesValue
=
gl
.
getContextAttributes
();
ContextAttributesValue
.
preserveDrawingBuffer
=
false
;
const
preserveDrawingBufferValue
=
ContextAttributesValue
.
preserveDrawingBuffer
;
console
.
info
(
"
webgltest webglContextAttributes_7:
"
+
preserveDrawingBufferValue
);
expect
(
preserveDrawingBufferValue
).
assertEqual
(
false
);
done
();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1347
* @tc.name webgl_test_webglContextAttributes
* @tc.desc Test webglContextAttributes.
*/
it
(
'
webgl_test_webglContextAttributes_8
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
webgltest into webglContextAttributes_8
"
);
const
ContextAttributesValue
=
gl
.
getContextAttributes
();
ContextAttributesValue
.
stencil
=
false
;
const
stencilValue
=
ContextAttributesValue
.
stencil
;
console
.
info
(
"
webgltest webglContextAttributes_8:
"
+
stencilValue
);
expect
(
stencilValue
).
assertEqual
(
false
);
done
();
})
})
graphic/webGL/src/main/js/default/test/webGL.test.js
浏览文件 @
25ba27c6
...
...
@@ -1996,8 +1996,14 @@ describe('webgl1Test_webgl1', function() {
return;
}
var viewPortParameter = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
var maxViewPortDimsParameter = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
console.log('maxViewPortDimsParameter: ' + maxViewPortDimsParameter);
var viewPortParameter = gl.getParameter(gl.VIEWPORT);
console.log('viewPortParameter: ' + viewPortParameter);
var boolParameter = gl.getParameter(gl.BOOL);
console.log('boolParameter: ' + boolParameter);
var SamplerCubeParameter = gl.getParameter(gl.SAMPLER_CUBE);
console.log('SamplerCubeParameter: ' + SamplerCubeParameter);
const isContextLostValue = gl.isContextLost();
console.info("isContextLostValue: " + isContextLostValue);
...
...
@@ -27024,9 +27030,11 @@ describe('webgl1Test_webgl1', function() {
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;
const precision = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).precision;
expect(min).assertEqual(24);
expect(max).assertEqual(127);
done();
expect(precision).assertEqual(23);
done();
});
/**
...
...
@@ -27152,6 +27160,9 @@ describe('webgl1Test_webgl1', function() {
var x8 = gl2.SYNC_FLAGS;
expect(x8).assertEqual(37141);
var x9 = gl2.OBJECT_TYPE;
expect(x9).assertEqual(37138);
done();
...
...
@@ -27165,11 +27176,15 @@ describe('webgl1Test_webgl1', function() {
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);
expect(attribute.alpha).assertEqual(true);
expect(attribute.antialias).assertEqual(true);
expect(attribute.depth).assertEqual(true);
expect(attribute.failIfMajorPerformanceCaveat).assertEqual(false);
expect(attribute.desynchronized).assertEqual(false);
expect(attribute.premultipliedAlpha).assertEqual(true);
expect(attribute.preserveDrawingBuffer).assertEqual(false);
expect(attribute.powerPreference).assertEqual("default");
expect(attribute.stencil).assertEqual(false);
done()
});
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录