OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/aligned_memory.h" | 10 #include "base/memory/aligned_memory.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 constraint_factory_2.AddOptional( | 330 constraint_factory_2.AddOptional( |
331 MediaAudioConstraints::kGoogEchoCancellation, true); | 331 MediaAudioConstraints::kGoogEchoCancellation, true); |
332 blink::WebMediaConstraints constraints_2 = | 332 blink::WebMediaConstraints constraints_2 = |
333 constraint_factory_2.CreateWebMediaConstraints(); | 333 constraint_factory_2.CreateWebMediaConstraints(); |
334 MediaAudioConstraints audio_constraints_2(constraints_2, 0); | 334 MediaAudioConstraints audio_constraints_2(constraints_2, 0); |
335 EXPECT_FALSE(audio_constraints_2.GetEchoCancellationProperty()); | 335 EXPECT_FALSE(audio_constraints_2.GetEchoCancellationProperty()); |
336 } | 336 } |
337 | 337 |
338 { | 338 { |
339 // When |kEchoCancellation| is explicitly set to false, the default values | 339 // When |kEchoCancellation| is explicitly set to false, the default values |
340 // for all the constraints except |kMediaStreamAudioDucking| are false. | 340 // for all the constraints are false. |
341 MockMediaConstraintFactory constraint_factory; | 341 MockMediaConstraintFactory constraint_factory; |
342 constraint_factory.AddOptional(MediaAudioConstraints::kEchoCancellation, | 342 constraint_factory.AddOptional(MediaAudioConstraints::kEchoCancellation, |
343 false); | 343 false); |
344 blink::WebMediaConstraints constraints = | 344 blink::WebMediaConstraints constraints = |
345 constraint_factory.CreateWebMediaConstraints(); | 345 constraint_factory.CreateWebMediaConstraints(); |
346 MediaAudioConstraints audio_constraints(constraints, 0); | 346 MediaAudioConstraints audio_constraints(constraints, 0); |
347 for (size_t i = 0; i < arraysize(kDefaultAudioConstraints); ++i) { | 347 for (size_t i = 0; i < arraysize(kDefaultAudioConstraints); ++i) { |
348 EXPECT_FALSE(audio_constraints.GetProperty(kDefaultAudioConstraints[i])); | 348 EXPECT_FALSE(audio_constraints.GetProperty(kDefaultAudioConstraints[i])); |
349 } | 349 } |
350 #if defined(OS_WIN) | |
351 EXPECT_TRUE(audio_constraints.GetProperty(kMediaStreamAudioDucking)); | |
352 #else | |
353 EXPECT_FALSE(audio_constraints.GetProperty(kMediaStreamAudioDucking)); | |
354 #endif | |
355 } | 350 } |
356 | 351 |
357 { | 352 { |
358 // |kMediaStreamAudioHotword| is always off by default. | 353 // |kMediaStreamAudioHotword| is always off by default. |
359 MockMediaConstraintFactory constraint_factory; | 354 MockMediaConstraintFactory constraint_factory; |
360 MediaAudioConstraints audio_constraints( | 355 MediaAudioConstraints audio_constraints( |
361 constraint_factory.CreateWebMediaConstraints(), 0); | 356 constraint_factory.CreateWebMediaConstraints(), 0); |
362 EXPECT_FALSE(audio_constraints.GetProperty(kMediaStreamAudioHotword)); | 357 EXPECT_FALSE(audio_constraints.GetProperty(kMediaStreamAudioHotword)); |
363 } | 358 } |
364 } | 359 } |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 expected.push_back(Point(0.02f, 0, 0)); | 547 expected.push_back(Point(0.02f, 0, 0)); |
553 ExpectPointVectorEqual(expected, ParseArrayGeometry("-0.02 0 0 0.02 0 0")); | 548 ExpectPointVectorEqual(expected, ParseArrayGeometry("-0.02 0 0 0.02 0 0")); |
554 } | 549 } |
555 { | 550 { |
556 PointVector expected(1, Point(1, 2, 3)); | 551 PointVector expected(1, Point(1, 2, 3)); |
557 ExpectPointVectorEqual(expected, ParseArrayGeometry("1 2 3")); | 552 ExpectPointVectorEqual(expected, ParseArrayGeometry("1 2 3")); |
558 } | 553 } |
559 } | 554 } |
560 | 555 |
561 } // namespace content | 556 } // namespace content |
OLD | NEW |