OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 TEST_F(CaptureManagerTest, InvalidAddingRemoving) { | 98 TEST_F(CaptureManagerTest, InvalidAddingRemoving) { |
99 EXPECT_FALSE(capture_manager_.StopVideoCapture(&video_capturer_, | 99 EXPECT_FALSE(capture_manager_.StopVideoCapture(&video_capturer_, |
100 cricket::VideoFormat())); | 100 cricket::VideoFormat())); |
101 EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_, | 101 EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_, |
102 format_vga_)); | 102 format_vga_)); |
103 EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait); | 103 EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait); |
104 EXPECT_EQ(1, callback_count()); | 104 EXPECT_EQ(1, callback_count()); |
105 EXPECT_FALSE(capture_manager_.AddVideoRenderer(&video_capturer_, NULL)); | 105 EXPECT_FALSE(capture_manager_.AddVideoRenderer(&video_capturer_, NULL)); |
106 EXPECT_FALSE(capture_manager_.RemoveVideoRenderer(&video_capturer_, | |
107 &video_renderer_)); | |
108 EXPECT_TRUE(capture_manager_.StopVideoCapture(&video_capturer_, format_vga_)); | 106 EXPECT_TRUE(capture_manager_.StopVideoCapture(&video_capturer_, format_vga_)); |
109 } | 107 } |
110 | 108 |
111 // Valid use cases | 109 // Valid use cases |
112 TEST_F(CaptureManagerTest, KeepFirstResolutionHigh) { | 110 TEST_F(CaptureManagerTest, KeepFirstResolutionHigh) { |
113 EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_, | 111 EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_, |
114 format_vga_)); | 112 format_vga_)); |
115 EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait); | 113 EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait); |
116 EXPECT_EQ(1, callback_count()); | 114 EXPECT_EQ(1, callback_count()); |
117 EXPECT_TRUE(capture_manager_.AddVideoRenderer(&video_capturer_, | 115 EXPECT_TRUE(capture_manager_.AddVideoRenderer(&video_capturer_, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // Now request restart with qvga. | 218 // Now request restart with qvga. |
221 EXPECT_TRUE(capture_manager_.RestartVideoCapture( | 219 EXPECT_TRUE(capture_manager_.RestartVideoCapture( |
222 &video_capturer_, format_vga_, format_qvga_, | 220 &video_capturer_, format_vga_, format_qvga_, |
223 cricket::CaptureManager::kRequestRestart)); | 221 cricket::CaptureManager::kRequestRestart)); |
224 EXPECT_TRUE(video_capturer_.CaptureFrame()); | 222 EXPECT_TRUE(video_capturer_.CaptureFrame()); |
225 EXPECT_EQ(2, NumFramesRendered()); | 223 EXPECT_EQ(2, NumFramesRendered()); |
226 EXPECT_TRUE(WasRenderedResolution(format_vga_)); | 224 EXPECT_TRUE(WasRenderedResolution(format_vga_)); |
227 EXPECT_TRUE(capture_manager_.StopVideoCapture(&video_capturer_, | 225 EXPECT_TRUE(capture_manager_.StopVideoCapture(&video_capturer_, |
228 format_qvga_)); | 226 format_qvga_)); |
229 } | 227 } |
OLD | NEW |