TEST_F(VideoSourceTest, SetValidOptionValues) {
FakeConstraints constraints;
constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, "false");
- constraints.AddMandatory(
- MediaConstraintsInterface::kTemporalLayeredScreencast, "false");
- constraints.AddOptional(
- MediaConstraintsInterface::kLeakyBucket, "true");
CreateVideoSource(&constraints);
bool value = true;
EXPECT_TRUE(source_->options()->video_noise_reduction.Get(&value));
EXPECT_FALSE(value);
- EXPECT_TRUE(source_->options()->
- video_temporal_layer_screencast.Get(&value));
- EXPECT_FALSE(value);
- EXPECT_TRUE(source_->options()->video_leaky_bucket.Get(&value));
- EXPECT_TRUE(value);
}
TEST_F(VideoSourceTest, OptionNotSet) {
bool value = false;
EXPECT_TRUE(source_->options()->video_noise_reduction.Get(&value));
EXPECT_TRUE(value);
- EXPECT_FALSE(source_->options()->video_leaky_bucket.Get(&value));
}
TEST_F(VideoSourceTest, InvalidOptionKeyOptional) {
TEST_F(VideoSourceTest, InvalidOptionValueOptional) {
FakeConstraints constraints;
constraints.AddOptional(
- MediaConstraintsInterface::kNoiseReduction, "true");
- constraints.AddOptional(
- MediaConstraintsInterface::kLeakyBucket, "not boolean");
+ MediaConstraintsInterface::kNoiseReduction, "not a boolean");
CreateVideoSource(&constraints);
EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(),
kMaxWaitMs);
bool value = false;
- EXPECT_TRUE(source_->options()->video_noise_reduction.Get(&value));
- EXPECT_TRUE(value);
- EXPECT_FALSE(source_->options()->video_leaky_bucket.Get(&value));
+ EXPECT_FALSE(source_->options()->video_noise_reduction.Get(&value));
}
TEST_F(VideoSourceTest, InvalidOptionValueMandatory) {
MediaConstraintsInterface::kNoiseReduction, "false");
// Values are case-sensitive and must be all lower-case.
constraints.AddMandatory(
- MediaConstraintsInterface::kLeakyBucket, "True");
+ MediaConstraintsInterface::kNoiseReduction, "True");
CreateVideoSource(&constraints);
bool value = true;
EXPECT_TRUE(source_->options()->video_noise_reduction.Get(&value));
EXPECT_FALSE(value);
- EXPECT_FALSE(source_->options()->video_leaky_bucket.Get(&value));
}
// Tests that the source starts video with the default resolution for