未验证 提交 4fe9048d 编写于 作者: O openharmony_ci 提交者: Gitee

!2710 删减webgl部分冗余用例

Merge pull request !2710 from 杨光宇/OpenHarmony-3.1-Release
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......@@ -813,25 +812,6 @@ describe('webgl1Test', function() {
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0233
* @tc.name testGetVertexAttribOffset
* @tc.desc Test getVertexAttribOffset.
*/
it('testGetVertexAttribOffset', 0, async function(done) {
//initContext();
console.info('jsWebGL getVertexAttribOffset test start ...' + JSON.stringify(gl));
gl.vertexAttrib1f(0, 2.8);
const index = gl.getVertexAttribOffset(0, gl.VERTEX_ATTRIB_ARRAY_POINTER);
console.info("getVertexAttribOffset: index" + index);
const errorCode = gl.getError();
console.info("jsWebGL getFramebufferAttachmentParameter errorCode: " + errorCode);
expect(errorCode).assertEqual(gl.INVALID_VALUE);
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0234
* @tc.name testUniform1f
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......@@ -1666,21 +1665,6 @@ describe('webgl1Test', function() {
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0382
* @tc.name testLineWidth
* @tc.desc Test lineWidth.
*/
it('testLineWidth', 0, async function(done) {
//initContext();
console.info('jsWebGL testLineWidth test start ...66');
gl.lineWidth(5);
const windtherror = gl.getError();
console.info("windtherror: " + windtherror);
expect(windtherror).assertEqual(gl.INVALID_VALUE);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0383
* @tc.name testLineWidth_01
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......@@ -866,25 +865,6 @@ describe('webgl1Test', function() {
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0434
* @tc.name testUniform1fv_2
* @tc.desc Test uniform1fv.
*/
it('testUniform1fv_2', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform1fv_2 test start ...66');
const framebuffer = gl.createFramebuffer();
const uniformlocationObj = gl.getUniformLocation(framebuffer, "a_Position1");
const flaot32list = new Float32Array([-1, -2]);
gl.uniform1fv(uniformlocationObj, flaot32list);
const uniform1fvError = gl.getError();
console.info("uniform1fvError: " + uniform1fvError);
const errorCode = gl.getError();
expect(uniform1fvError).assertEqual(gl.INVALID_OPERATION);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0435
* @tc.name testUniform1fv_3
......@@ -904,25 +884,6 @@ describe('webgl1Test', function() {
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0436
* @tc.name testUniform1fv_4
* @tc.desc Test uniform1fv.
*/
it('testUniform1fv_4', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform1fv_4 test start ...66');
const renderbuffer = gl.createRenderbuffer();
const uniformlocationObj = gl.getUniformLocation(renderbuffer, "a_Position1");
const flaot32list = new Float32Array([-1, -2]);
gl.uniform1fv(uniformlocationObj, flaot32list);
const uniform1fvError = gl.getError();
console.info("uniform1fvError: " + uniform1fvError);
const errorCode = gl.getError();
expect(uniform1fvError).assertEqual(gl.INVALID_OPERATION);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0437
* @tc.name testUniform2fv
......@@ -941,24 +902,6 @@ describe('webgl1Test', function() {
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0438
* @tc.name testUniform2fv_1
* @tc.desc Test uniform2fv.
*/
it('testUniform2fv_1', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform2fv_1 test start ...66');
const renderbuffer = gl.createRenderbuffer();
const uniformlocationObj = gl.getUniformLocation(renderbuffer, "123");
const flaot32list = new Float32Array([1, 2]);
gl.uniform2fv(uniformlocationObj, flaot32list);
const uniform2fvError = gl.getError();
console.info("uniform2fvError: " + uniform2fvError);
expect(uniform2fvError).assertEqual(gl.INVALID_OPERATION);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0439
* @tc.name testUniform2fv_2
......@@ -977,24 +920,6 @@ describe('webgl1Test', function() {
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0440
* @tc.name testUniform2fv_3
* @tc.desc Test uniform2fv.
*/
it('testUniform2fv_3', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform2fv_3 test start ...66');
const framebuffer = gl.createFramebuffer();
const uniformlocationObj = gl.getUniformLocation(framebuffer, "a_Position");
const flaot32list = new Float32Array([1, 2]);
gl.uniform2fv(uniformlocationObj, flaot32list);
const uniform2fvError = gl.getError();
console.info("uniform2fvError: " + uniform2fvError);
expect(uniform2fvError).assertEqual(gl.INVALID_OPERATION);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0441
* @tc.name testUniform2fv_4
......@@ -1049,24 +974,6 @@ describe('webgl1Test', function() {
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0444
* @tc.name testUniform3fv_2
* @tc.desc Test uniform3fv.
*/
it('testUniform3fv_2', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform3fv_2 test start ...66');
const framebuffer = gl.createFramebuffer();
const uniformlocationObj = gl.getUniformLocation(framebuffer, "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.name testUniform3fv_4
......@@ -1121,24 +1028,6 @@ describe('webgl1Test', function() {
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0450
* @tc.name testUniform4fv_03
* @tc.desc Test uniform4fv.
*/
it('testUniform4fv_03', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform4fv_03 test start ...66');
const framebuffer = gl.createFramebuffer();
const uniformlocationObj = gl.getUniformLocation(framebuffer, "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_0451
* @tc.name testUniform4fv_04
......@@ -1193,60 +1082,6 @@ describe('webgl1Test', function() {
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0454
* @tc.name testUniform1iv_02
* @tc.desc Test uniform1iv.
*/
it('testUniform1iv_02', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform1iv_02 test start ...66');
const renderbuffer = gl.createRenderbuffer();
const uniformlocationObj = gl.getUniformLocation(renderbuffer, "a_Position");
const int32list = new Int32Array([1, 2]);
gl.uniform1iv(uniformlocationObj, int32list);
const uniform1ivError = gl.getError();
console.info("uniform1ivError: " + uniform1ivError);
expect(uniform1ivError).assertEqual(gl.INVALID_OPERATION);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0455
* @tc.name testUniform1iv_03
* @tc.desc Test uniform1iv.
*/
it('testUniform1iv_03', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform1iv_03 test start ...66');
const framebuffer = gl.createFramebuffer();
const uniformlocationObj = gl.getUniformLocation(framebuffer, "a_Position");
const int32list = new Int32Array([1, 2]);
gl.uniform1iv(uniformlocationObj, int32list);
const uniform1ivError = gl.getError();
console.info("uniform1ivError: " + uniform1ivError);
expect(uniform1ivError).assertEqual(gl.INVALID_OPERATION);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0456
* @tc.name testUniform1iv_04
* @tc.desc Test uniform1iv.
*/
it('testUniform1iv_04', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform1iv_04 test start ...66');
const shader = gl.createShader(gl.VERTEX_SHADER);
const uniformlocationObj = gl.getUniformLocation(shader, "a_Position");
const int32list = new Int32Array([1, 2]);
gl.uniform1iv(uniformlocationObj, int32list);
const uniform1ivError = gl.getError();
console.info("uniform1ivError: " + uniform1ivError);
expect(uniform1ivError).assertEqual(gl.INVALID_OPERATION);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0457
* @tc.name testUniform2iv
......@@ -1283,24 +1118,6 @@ describe('webgl1Test', function() {
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0459
* @tc.name testUniform2iv_02
* @tc.desc Test uniform2iv.
*/
it('testUniform2iv_02', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform2iv_02 test start ...66');
const renderbuffer = gl.createRenderbuffer();
const uniformlocationObj = gl.getUniformLocation(renderbuffer, "a_Position");
const int32list = new Int32Array([1, 2]);
gl.uniform2iv(uniformlocationObj, int32list);
const uniform2ivError = gl.getError();
console.info("testUniform2ivError: " + uniform2ivError);
expect(uniform2ivError).assertEqual(gl.INVALID_OPERATION);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0461
* @tc.name testUniform2iv_04
......@@ -1355,24 +1172,6 @@ describe('webgl1Test', function() {
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0465
* @tc.name testUniform3iv_03
* @tc.desc Test uniform3iv.
*/
it('testUniform3iv_03', 0, async function(done) {
//initContext();
console.info('jsWebGL testUniform3iv_03 test start ...66');
var texture = gl.createTexture();
const uniformlocationObj = gl.getUniformLocation(texture, "a_Position");
const int32list = new Int32Array([1, 2]);
gl.uniform3iv(uniformlocationObj, int32list);
const uniform3ivError = gl.getError();
console.info("testUniform3ivError: " + uniform3ivError);
expect(uniform3ivError).assertEqual(gl.INVALID_OPERATION);
done();
})
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0466
* @tc.name testUniform3iv_04
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......@@ -747,61 +746,6 @@ describe('webgl1Test', function() {
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0626
* @tc.name webgl_test_detachShader2
* @tc.desc Test detachShader.
*/
it('webgl_test_detachShader2', 0, async function(done) {
//initContext();
console.info("webgltest into detachShader");
//顶点着色器
var vertexShader = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vertexShader, VSHADER_SOURCE);
gl.compileShader(vertexShader);
//片元着色器
var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER); //创建 WebGLShader。
gl.shaderSource(fragmentShader, FSHADER_SOURCE); //fragmentSrc设置一个 WebGLShader 的源码。
gl.compileShader(fragmentShader);
//WebGLProgram
var program = gl.createProgram(); //创建 WebGLProgram
gl.attachShader(program, vertexShader); //往 WebGLProgram 添加一个片段或者顶点着色器。
gl.attachShader(program, fragmentShader);
gl.linkProgram(program); //链接给入的 WebGLProgram 对象
gl.detachShader(program, "vertexShader"); //从一个WebGLProgram中分离一个先前附加的片段或者顶点着色器;
gl.detachShader(program, "fragmentShader");
gl.deleteShader(vertexShader);
gl.deleteShader(fragmentShader);
let errorCode = gl.getError();
console.info("webgltest uniform3uiv getError: " + errorCode);
expect(errorCode).assertEqual(gl.NO_ERROR);
//deleteContext();
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0627
* @tc.name webgl_test_disableVertexAttribArray2
* @tc.desc Test disableVertexAttribArray.
*/
it('webgl_test_disableVertexAttribArray2', 0, async function(done) {
//initContext();
console.info("webgltest into disableVertexAttribArray");
gl.disableVertexAttribArray("error");
let errorCode = gl.getError();
console.info("webgltest disableVertexAttribArray getError: " + errorCode);
expect(errorCode).assertEqual(gl.NO_ERROR);
//deleteContext();
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0628
* @tc.name webgl_test_enableVertexAttribArray2
......@@ -945,8 +889,6 @@ describe('webgl1Test', function() {
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0639
* @tc.name webgl_test_bindSampler2
......@@ -973,27 +915,6 @@ describe('webgl1Test', function() {
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0640
* @tc.name webgl_test_samplerParameteri2
* @tc.desc Test samplerParameteri.
*/
it('webgl_test_samplerParameteri2', 0, async function(done) {
//initContext();
console.info("webgltest into samplerParameteri");
let sampler = gl2.createSampler();
gl2.samplerParameteri(sampler, gl.TEXTURE_MAG_FILTER);
let errorCode = gl.getError();
console.info("webgltest samplerParameteri getError: " + errorCode);
expect(errorCode).assertEqual(gl.INVALID_OPERATION);
gl2.deleteSampler(sampler);
//deleteContext();
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0641
* @tc.name webgl_test_samplerParameterf2
......@@ -1275,28 +1196,6 @@ describe('webgl1Test', function() {
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0652
* @tc.name webgl_test_endTransformFeedback2
* @tc.desc Test endTransformFeedback.
*/
it('webgl_test_endTransformFeedback2', 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('error');
let errorCode = gl.getError();
console.info("webgltest framebufferTexture2D getError: " + errorCode);
expect(errorCode).assertEqual(gl.INVALID_FRAMEBUFFER_OPERATION);
//deleteContext();
done();
});
/**
* @tc.number GRAPHIC_FUNCTION_JS_WEBGL_TESTWEBGL_0653
* @tc.name webgl_test_deleteTransformFeedback2
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import webgl from "@ohos.webglnapi";
import Context from '@ohos.napi_context'
import {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册