OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/media/media_internals.h" | 5 #include "content/browser/media/media_internals.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // an expected format and there are no public methods for accessing the | 140 // an expected format and there are no public methods for accessing the |
141 // resolutions, frame rates or pixel formats, this test checks that the format | 141 // resolutions, frame rates or pixel formats, this test checks that the format |
142 // has not changed. If the test fails because of the changed format, it should | 142 // has not changed. If the test fails because of the changed format, it should |
143 // be updated at the same time as the media internals JS files. | 143 // be updated at the same time as the media internals JS files. |
144 const float kFrameRate = 30.0f; | 144 const float kFrameRate = 30.0f; |
145 const gfx::Size kFrameSize(1280, 720); | 145 const gfx::Size kFrameSize(1280, 720); |
146 const media::VideoPixelFormat kPixelFormat = media::PIXEL_FORMAT_I420; | 146 const media::VideoPixelFormat kPixelFormat = media::PIXEL_FORMAT_I420; |
147 const media::VideoCaptureFormat capture_format( | 147 const media::VideoCaptureFormat capture_format( |
148 kFrameSize, kFrameRate, kPixelFormat); | 148 kFrameSize, kFrameRate, kPixelFormat); |
149 const std::string expected_string = | 149 const std::string expected_string = |
150 base::StringPrintf("resolution: %s, fps: %f, pixel format: %s", | 150 base::StringPrintf("resolution: %s, fps: %.3f, pixel format: %s", |
151 kFrameSize.ToString().c_str(), | 151 kFrameSize.ToString().c_str(), |
152 kFrameRate, | 152 kFrameRate, |
153 media::VideoCaptureFormat::PixelFormatToString( | 153 media::VideoCaptureFormat::PixelFormatToString( |
154 kPixelFormat).c_str()); | 154 kPixelFormat).c_str()); |
155 EXPECT_EQ(expected_string, capture_format.ToString()); | 155 EXPECT_EQ(expected_string, capture_format.ToString()); |
156 } | 156 } |
157 | 157 |
158 TEST_F(MediaInternalsVideoCaptureDeviceTest, | 158 TEST_F(MediaInternalsVideoCaptureDeviceTest, |
159 NotifyVideoCaptureDeviceCapabilitiesEnumerated) { | 159 NotifyVideoCaptureDeviceCapabilitiesEnumerated) { |
160 const int kWidth = 1280; | 160 const int kWidth = 1280; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 ExpectStatus("closed"); | 282 ExpectStatus("closed"); |
283 } | 283 } |
284 | 284 |
285 INSTANTIATE_TEST_CASE_P( | 285 INSTANTIATE_TEST_CASE_P( |
286 MediaInternalsAudioLogTest, MediaInternalsAudioLogTest, testing::Values( | 286 MediaInternalsAudioLogTest, MediaInternalsAudioLogTest, testing::Values( |
287 media::AudioLogFactory::AUDIO_INPUT_CONTROLLER, | 287 media::AudioLogFactory::AUDIO_INPUT_CONTROLLER, |
288 media::AudioLogFactory::AUDIO_OUTPUT_CONTROLLER, | 288 media::AudioLogFactory::AUDIO_OUTPUT_CONTROLLER, |
289 media::AudioLogFactory::AUDIO_OUTPUT_STREAM)); | 289 media::AudioLogFactory::AUDIO_OUTPUT_STREAM)); |
290 | 290 |
291 } // namespace content | 291 } // namespace content |
OLD | NEW |