Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
30083bce
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看板
未验证
提交
30083bce
编写于
3月 09, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2267 【图形子系统】增加webGL测试用例
Merge pull request !2267 from zxg-gitee/master
上级
fae7f0da
fd3a3ae2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
160 addition
and
0 deletion
+160
-0
graphic/webGL/src/main/js/default/test/webGL.test.js
graphic/webGL/src/main/js/default/test/webGL.test.js
+160
-0
未找到文件。
graphic/webGL/src/main/js/default/test/webGL.test.js
100644 → 100755
浏览文件 @
30083bce
...
...
@@ -27472,4 +27472,164 @@ describe('webgl1Test', function() {
expect(texParameterValue).assertEqual(gl.COMPARE_REF_TO_TEXTURE);
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1335
* @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_1335
* @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_1335
* @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_1335
* @tc.name testRendingContextBase
* @tc.desc Test RendingContextBase.
*/
it ('testRendingContextBase', 0, async function(done) {
console.info('jsWebGL testRendingContextBase test start');
const buffer = gl.createBuffer();
expect(typeof(buffer)).assertEqual('object');
var x1 = gl2.COLOR;
expect(x1).assertEqual(6144);
var x2 = gl2.STENCIL;
expect(x2).assertEqual(6146);
var x3 = gl2.MIN;
expect(x3).assertEqual(32775);
var x4 = gl2.MAX;
expect(x4).assertEqual(32776);
var x5 = gl2.RG;
expect(x5).assertEqual(33319);
var x6 = gl2.SYNC_CONDITION;
expect(x6).assertEqual(37139);
var x7 = gl2.SYNC_STATUS;
expect(x7).assertEqual(37140);
var x8 = gl2.SYNC_FLAGS;
expect(x8).assertEqual(37141);
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_1335
* @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()
});
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录