Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: content/renderer/media/media_stream_audio_processor_unittest.cc

Issue 367923004: Turn audio ducking on by default on Windows again. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/aligned_memory.h" 9 #include "base/memory/aligned_memory.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 constraint_factory.AddOptional(MediaAudioConstraints::kEchoCancellation, 329 constraint_factory.AddOptional(MediaAudioConstraints::kEchoCancellation,
330 false); 330 false);
331 blink::WebMediaConstraints constraints = 331 blink::WebMediaConstraints constraints =
332 constraint_factory.CreateWebMediaConstraints(); 332 constraint_factory.CreateWebMediaConstraints();
333 MediaAudioConstraints audio_constraints(constraints, 0); 333 MediaAudioConstraints audio_constraints(constraints, 0);
334 for (size_t i = 0; i < arraysize(kDefaultAudioConstraints); ++i) { 334 for (size_t i = 0; i < arraysize(kDefaultAudioConstraints); ++i) {
335 EXPECT_FALSE(audio_constraints.GetProperty(kDefaultAudioConstraints[i])); 335 EXPECT_FALSE(audio_constraints.GetProperty(kDefaultAudioConstraints[i]));
336 } 336 }
337 EXPECT_FALSE(audio_constraints.NeedsAudioProcessing()); 337 EXPECT_FALSE(audio_constraints.NeedsAudioProcessing());
338 #if defined(OS_WIN) 338 #if defined(OS_WIN)
339 // TODO(tommi): Turn this back to EXPECT_TRUE on Windows when ducking issues 339 EXPECT_TRUE(audio_constraints.GetProperty(kMediaStreamAudioDucking));
340 // have been resolved.
341 // Bugs: crbug/391414, crbug/391247.
342 EXPECT_FALSE(audio_constraints.GetProperty(kMediaStreamAudioDucking));
343 #else 340 #else
344 EXPECT_FALSE(audio_constraints.GetProperty(kMediaStreamAudioDucking)); 341 EXPECT_FALSE(audio_constraints.GetProperty(kMediaStreamAudioDucking));
345 #endif 342 #endif
346 } 343 }
347 } 344 }
348 345
349 TEST_F(MediaStreamAudioProcessorTest, ValidateConstraints) { 346 TEST_F(MediaStreamAudioProcessorTest, ValidateConstraints) {
350 MockMediaConstraintFactory constraint_factory; 347 MockMediaConstraintFactory constraint_factory;
351 const std::string dummy_constraint = "dummy"; 348 const std::string dummy_constraint = "dummy";
352 constraint_factory.AddMandatory(dummy_constraint, true); 349 constraint_factory.AddMandatory(dummy_constraint, true);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 EXPECT_EQ(output_bus->channel(0)[0], 0); 463 EXPECT_EQ(output_bus->channel(0)[0], 0);
467 EXPECT_NE(output_bus->channel(1)[0], 0); 464 EXPECT_NE(output_bus->channel(1)[0], 0);
468 } 465 }
469 466
470 // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives 467 // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives
471 // |audio_processor|. 468 // |audio_processor|.
472 audio_processor = NULL; 469 audio_processor = NULL;
473 } 470 }
474 471
475 } // namespace content 472 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698