From fa1d51fe44174f251918ee9d7af05510fc48adf1 Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Sat, 26 Jan 2019 12:19:28 -0500 Subject: [PATCH] Comment out WebGl tests --- .../wasm/whitelisted_immutable_slices.rs | 46 +++++++++++-------- crates/webidl/src/util.rs | 10 ++-- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs index 3b0cac98..453e9822 100644 --- a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs +++ b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs @@ -17,28 +17,36 @@ use web_sys::WebGlRenderingContext; #[wasm_bindgen(module = "./tests/wasm/element.js")] extern "C" { fn new_webgl_rendering_context() -> WebGlRenderingContext; + // TODO: Add a function to create another type to test here. + // These functions come from element.js } +// TODO: Uncomment WebGlRenderingContext test... +// Currently commented out because WebGl isn't working in geckodriver. +// It currently works in chromedriver so if you need to run this in the meantime you can +// uncomment this block and run it in using chromedriver. +// +// CHROMEDRIVER=chromedriver cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features --test test_webgl_rendering_context_immutable_slices + // Ensure that our whitelisted WebGlRenderingContext methods work -#[wasm_bindgen_test] -fn test_webgl_rendering_context_immutable_slices() { - // WebGl wasn't working in headless firefox at the time of writing.. - let gl = new_webgl_rendering_context(); - - gl.vertex_attrib1fv_with_f32_array(0, &[1.]); - gl.vertex_attrib2fv_with_f32_array(0, &[1.]); - gl.vertex_attrib3fv_with_f32_array(0, &[1.]); - gl.vertex_attrib4fv_with_f32_array(0, &[1.]); - - gl.uniform1fv_with_f32_array(None, &[1.]); - gl.uniform2fv_with_f32_array(None, &[1.]); - gl.uniform3fv_with_f32_array(None, &[1.]); - gl.uniform4fv_with_f32_array(None, &[1.]); - - gl.uniform_matrix2fv_with_f32_array(None, false, &[1.]); - gl.uniform_matrix3fv_with_f32_array(None, false, &[1.]); - gl.uniform_matrix4fv_with_f32_array(None, false, &[1.]); -} +//#[wasm_bindgen_test] +//fn test_webgl_rendering_context_immutable_slices() { +// let gl = new_webgl_rendering_context(); +// +// gl.vertex_attrib1fv_with_f32_array(0, &[1.]); +// gl.vertex_attrib2fv_with_f32_array(0, &[1.]); +// gl.vertex_attrib3fv_with_f32_array(0, &[1.]); +// gl.vertex_attrib4fv_with_f32_array(0, &[1.]); +// +// gl.uniform1fv_with_f32_array(None, &[1.]); +// gl.uniform2fv_with_f32_array(None, &[1.]); +// gl.uniform3fv_with_f32_array(None, &[1.]); +// gl.uniform4fv_with_f32_array(None, &[1.]); +// +// gl.uniform_matrix2fv_with_f32_array(None, false, &[1.]); +// gl.uniform_matrix3fv_with_f32_array(None, false, &[1.]); +// gl.uniform_matrix4fv_with_f32_array(None, false, &[1.]); +//} // TODO: //#[wasm_bindgen_test] diff --git a/crates/webidl/src/util.rs b/crates/webidl/src/util.rs index e12146b8..2b3b86df 100644 --- a/crates/webidl/src/util.rs +++ b/crates/webidl/src/util.rs @@ -724,10 +724,6 @@ pub fn public() -> syn::Visibility { fn maybe_adjust<'a>(mut idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { let immutable_f32_fns: Vec<&'static str> = vec![ // WebGlRenderingContext - "vertexAttrib1fv", - "vertexAttrib2fv", - "vertexAttrib3fv", - "vertexAttrib4fv", "uniform1fv", "uniform2fv", "uniform3fv", @@ -735,7 +731,11 @@ fn maybe_adjust<'a>(mut idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<' "uniformMatrix2fv", "uniformMatrix3fv", "uniformMatrix4fv", - // TODO: Add another type's functions here + "vertexAttrib1fv", + "vertexAttrib2fv", + "vertexAttrib3fv", + "vertexAttrib4fv", + // TODO: Add another type's functions here. Leave a comment header with the type name ]; let mut immutable_f32_slice_whitelist: HashSet<&'static str> = HashSet::new();