[dawn] Add test that the bindless WGSL enable requires the feature.

A test was added in ShaderModuleValidationTests but these only check
that experimental features are not available to devices that are not
allowed to use experimental features. Also add a test targeted for
bindless in addition to that.

Bug: 435317394
Change-Id: I8fea8f607fa31dbea15c82a0f1ee816f1b97d676
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/258994
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn/tests/unittests/validation/DynamicBindingArrayValidationTests.cpp b/src/dawn/tests/unittests/validation/DynamicBindingArrayValidationTests.cpp
index 766c45a..7c96f2d 100644
--- a/src/dawn/tests/unittests/validation/DynamicBindingArrayValidationTests.cpp
+++ b/src/dawn/tests/unittests/validation/DynamicBindingArrayValidationTests.cpp
@@ -619,6 +619,18 @@
     }
 }
 
+// Test that using the WGSL enable requires the bindless extension.
+TEST_F(DynamicBindingArrayTests_FeatureDisabled, WGSLEnableNotAllowed) {
+    ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"(
+        enable chromium_experimental_dynamic_binding;
+        @group(0) @binding(0) var a : binding_array<texture_2d<f32>>;
+
+        @compute @workgroup_size(1) fn main() {
+            _ = a[42];
+        }
+    )"));
+}
+
 // Test that a shader using a dynamic binding array requires a layout with one.
 TEST_F(DynamicBindingArrayTests, ShaderRequiresLayoutWithDynamicArray) {
     wgpu::ComputePipelineDescriptor csDesc;