| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 const std::string video_constraint = | 74 const std::string video_constraint = |
| 75 "video: {optional: [{ sourceId:\"" + video_source_id + "\"}]}"; | 75 "video: {optional: [{ sourceId:\"" + video_source_id + "\"}]}"; |
| 76 return function_name + "({" + audio_constraint + video_constraint + "});"; | 76 return function_name + "({" + audio_constraint + video_constraint + "});"; |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace | 79 } // namespace |
| 80 | 80 |
| 81 namespace content { | 81 namespace content { |
| 82 | 82 |
| 83 class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest { | 83 class WebRtcGetUserMediaBrowserTest : public WebRtcContentBrowserTestBase { |
| 84 public: | 84 public: |
| 85 WebRtcGetUserMediaBrowserTest() : trace_log_(NULL) { | 85 WebRtcGetUserMediaBrowserTest() : trace_log_(NULL) { |
| 86 // Automatically grant device permission. | 86 // Automatically grant device permission. |
| 87 AppendUseFakeUIForMediaStreamFlag(); | 87 AppendUseFakeUIForMediaStreamFlag(); |
| 88 } | 88 } |
| 89 ~WebRtcGetUserMediaBrowserTest() override {} | 89 ~WebRtcGetUserMediaBrowserTest() override {} |
| 90 | 90 |
| 91 void StartTracing() { | 91 void StartTracing() { |
| 92 CHECK(trace_log_ == NULL) << "Can only can start tracing once"; | 92 CHECK(trace_log_ == NULL) << "Can only can start tracing once"; |
| 93 trace_log_ = base::trace_event::TraceLog::GetInstance(); | 93 trace_log_ = base::trace_event::TraceLog::GetInstance(); |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 int max_width; | 725 int max_width; |
| 726 int min_height; | 726 int min_height; |
| 727 int max_height; | 727 int max_height; |
| 728 int min_frame_rate; | 728 int min_frame_rate; |
| 729 int max_frame_rate; | 729 int max_frame_rate; |
| 730 }; | 730 }; |
| 731 | 731 |
| 732 } // namespace | 732 } // namespace |
| 733 | 733 |
| 734 class WebRtcConstraintsBrowserTest | 734 class WebRtcConstraintsBrowserTest |
| 735 : public WebRtcContentBrowserTest, | 735 : public WebRtcContentBrowserTestBase, |
| 736 public testing::WithParamInterface<UserMediaSizes> { | 736 public testing::WithParamInterface<UserMediaSizes> { |
| 737 public: | 737 public: |
| 738 WebRtcConstraintsBrowserTest() : user_media_(GetParam()) { | 738 WebRtcConstraintsBrowserTest() : user_media_(GetParam()) { |
| 739 // Automatically grant device permission. | 739 // Automatically grant device permission. |
| 740 AppendUseFakeUIForMediaStreamFlag(); | 740 AppendUseFakeUIForMediaStreamFlag(); |
| 741 } | 741 } |
| 742 const UserMediaSizes& user_media() const { return user_media_; } | 742 const UserMediaSizes& user_media() const { return user_media_; } |
| 743 | 743 |
| 744 private: | 744 private: |
| 745 UserMediaSizes user_media_; | 745 UserMediaSizes user_media_; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 776 {640, 640, 360, 360, 10, 30}, | 776 {640, 640, 360, 360, 10, 30}, |
| 777 {640, 640, 480, 480, 10, 30}, | 777 {640, 640, 480, 480, 10, 30}, |
| 778 {960, 960, 720, 720, 10, 30}, | 778 {960, 960, 720, 720, 10, 30}, |
| 779 {1280, 1280, 720, 720, 10, 30}}; | 779 {1280, 1280, 720, 720, 10, 30}}; |
| 780 | 780 |
| 781 INSTANTIATE_TEST_CASE_P(UserMedia, | 781 INSTANTIATE_TEST_CASE_P(UserMedia, |
| 782 WebRtcConstraintsBrowserTest, | 782 WebRtcConstraintsBrowserTest, |
| 783 testing::ValuesIn(kAllUserMediaSizes)); | 783 testing::ValuesIn(kAllUserMediaSizes)); |
| 784 | 784 |
| 785 } // namespace content | 785 } // namespace content |
| OLD | NEW |