Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / renderer / media / mock_media_stream_video_source.h
index d0d82e6..ff70fb5 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "content/renderer/media/media_stream_video_source.h"
 
+#include "testing/gmock/include/gmock/gmock.h"
+
 namespace content {
 
 class MockMediaStreamVideoSource : public MediaStreamVideoSource {
@@ -14,6 +16,8 @@ class MockMediaStreamVideoSource : public MediaStreamVideoSource {
   explicit MockMediaStreamVideoSource(bool manual_get_supported_formats);
   virtual ~MockMediaStreamVideoSource();
 
+  MOCK_METHOD1(DoSetMutedState, void(bool muted_state));
+
   // Simulate that the underlying source start successfully.
   void StartMockedSource();
 
@@ -35,31 +39,40 @@ class MockMediaStreamVideoSource : public MediaStreamVideoSource {
 
   void CompleteGetSupportedFormats();
 
-  const media::VideoCaptureParams& start_params() const { return params_; }
+  const media::VideoCaptureFormat& start_format() const { return format_; }
   int max_requested_height() const { return max_requested_height_; }
   int max_requested_width() const { return max_requested_width_; }
+  double max_requested_frame_rate() const { return max_requested_frame_rate_; }
+
+  virtual void SetMutedState(bool muted_state) OVERRIDE {
+    MediaStreamVideoSource::SetMutedState(muted_state);
+    DoSetMutedState(muted_state);
+  }
 
  protected:
   void DeliverVideoFrameOnIO(const scoped_refptr<media::VideoFrame>& frame,
                              media::VideoCaptureFormat format,
+                             const base::TimeTicks& estimated_capture_time,
                              const VideoCaptureDeliverFrameCB& frame_callback);
 
   // Implements MediaStreamVideoSource.
   virtual void GetCurrentSupportedFormats(
       int max_requested_height,
       int max_requested_width,
+      double max_requested_frame_rate,
       const VideoCaptureDeviceFormatsCB& callback) OVERRIDE;
   virtual void StartSourceImpl(
-      const media::VideoCaptureParams& params,
+      const media::VideoCaptureFormat& format,
       const VideoCaptureDeliverFrameCB& frame_callback) OVERRIDE;
   virtual void StopSourceImpl() OVERRIDE;
 
  private:
-  media::VideoCaptureParams params_;
+  media::VideoCaptureFormat format_;
   media::VideoCaptureFormats supported_formats_;
   bool manual_get_supported_formats_;
   int max_requested_height_;
   int max_requested_width_;
+  double max_requested_frame_rate_;
   bool attempted_to_start_;
   VideoCaptureDeviceFormatsCB formats_callback_;
   VideoCaptureDeliverFrameCB frame_callback_;