Use Chromium's dcheck_always_on when available.

This will make GPU tests running on Chromium-based builders respect this
configuration, which is important to have the same code run in Release
and Debug builds on the GPU FYI waterfall.

BUG=chromium:901830

Change-Id: Ia2f6f3585c4b6213fe7f55203c69d0ef4a620a67
Reviewed-on: https://dawn-review.googlesource.com/c/2708
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kenneth Russell <kbr@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 1a4922f..869c332 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -18,6 +18,14 @@
 
 import("//testing/test.gni")
 
+# Use Chromium's dcheck_always_on when available so that we respect it when
+# running tests on the GPU builders
+if (build_with_chromium) {
+  import("//build/config/dcheck_always_on.gni")
+} else {
+  dcheck_always_on = false
+}
+
 ###############################################################################
 # Template to wrap the Dawn code generator
 ###############################################################################
@@ -153,7 +161,7 @@
   include_dirs = [ "src" ]
 
   defines = []
-  if (dawn_always_assert || is_debug) {
+  if (dawn_always_assert || dcheck_always_on || is_debug) {
     defines += [ "DAWN_ENABLE_ASSERTS" ]
   }