Improve the mechanism to suppress warning messages during testing

It's important to suppress warning messages during tests that
intentionally trigger them, in order to not confuse users. This CL
attempts to make the suppression mechanism more general, and then
suppresses another warning that has started coming out in dm.

Bug=skia:9927
Change-Id: I67b5bcd1865f4001964bbdc967b0327682b4258b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271177
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
9 files changed