提交 3d90a9a0 编写于 作者: Z zleoyu

覆盖用例

WebGLContextAttributes类中的alpha depth stencil powerPreference
WebGLRenderingContextBase类中的VIEWPORT BOOL SAMPLER_CUBE
WebGL2RenderingContextBase类中的OBJECT_TYPE
WebGLRenderingContextBase类中的canvas
Signed-off-by: Nzleoyu <zhangleiyu1@huawei.com>
Change-Id: Id4b9bf353be581367717c7b4b57b003656f009b3
上级 bbfa1e51
......@@ -248,14 +248,14 @@ describe('webgl1Test_webgl2', function() {
function initContext() {
console.info('initContext start');
// 获取canvas元素
const el = global.el;
const el2 = global.el2;
const canvas = global.el;
const canvas2 = 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 = el2.getContext('webgl2');
gl2 = canvas2.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);
......
......@@ -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();
});
})
......@@ -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();
})
})
......@@ -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.
先完成此消息的编辑!
想要评论请 注册