Partly migrate test/ to webrtc::Mutex.

This change migrates test/, except for subdirs
  - test/time_controller
  - test/pc/e2e

Bug: webrtc:11567
Change-Id: Ib6f7c062f1c66caf7083fb4ec60727d66299dbeb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178819
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31675}
diff --git a/test/frame_generator.h b/test/frame_generator.h
index 6f59c1e..94e15cb 100644
--- a/test/frame_generator.h
+++ b/test/frame_generator.h
@@ -20,8 +20,8 @@
 #include "api/video/video_frame.h"
 #include "api/video/video_frame_buffer.h"
 #include "api/video/video_source_interface.h"
-#include "rtc_base/critical_section.h"
 #include "rtc_base/random.h"
+#include "rtc_base/synchronization/mutex.h"
 #include "system_wrappers/include/clock.h"
 
 namespace webrtc {
@@ -57,11 +57,11 @@
     const uint8_t yuv_a_;
   };
 
-  rtc::CriticalSection crit_;
+  Mutex mutex_;
   const OutputType type_;
-  int width_ RTC_GUARDED_BY(&crit_);
-  int height_ RTC_GUARDED_BY(&crit_);
-  std::vector<std::unique_ptr<Square>> squares_ RTC_GUARDED_BY(&crit_);
+  int width_ RTC_GUARDED_BY(&mutex_);
+  int height_ RTC_GUARDED_BY(&mutex_);
+  std::vector<std::unique_ptr<Square>> squares_ RTC_GUARDED_BY(&mutex_);
 };
 
 class YuvFileGenerator : public FrameGeneratorInterface {