OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 Controller::NetworkMetrics metrics; | 352 Controller::NetworkMetrics metrics; |
353 | 353 |
354 auto controllers = states.controller_manager->GetSortedControllers(metrics); | 354 auto controllers = states.controller_manager->GetSortedControllers(metrics); |
355 CheckControllersOrder( | 355 CheckControllersOrder( |
356 controllers, | 356 controllers, |
357 std::vector<ControllerType>{ | 357 std::vector<ControllerType>{ |
358 ControllerType::FEC, ControllerType::CHANNEL, ControllerType::DTX, | 358 ControllerType::FEC, ControllerType::CHANNEL, ControllerType::DTX, |
359 ControllerType::FRAME_LENGTH, ControllerType::BIT_RATE}); | 359 ControllerType::FRAME_LENGTH, ControllerType::BIT_RATE}); |
360 } | 360 } |
361 | 361 |
| 362 TEST(ControllerManagerTest, CreateCharPointFreeConfigAndCheckDefaultOrder) { |
| 363 audio_network_adaptor::config::ControllerManager config; |
| 364 |
| 365 // Following controllers have no characteristic points. |
| 366 AddChannelControllerConfig(&config); |
| 367 AddDtxControllerConfig(&config); |
| 368 AddBitrateControllerConfig(&config); |
| 369 |
| 370 ProtoString config_string; |
| 371 config.SerializeToString(&config_string); |
| 372 |
| 373 auto states = CreateControllerManager(config_string); |
| 374 Controller::NetworkMetrics metrics; |
| 375 |
| 376 auto controllers = states.controller_manager->GetSortedControllers(metrics); |
| 377 CheckControllersOrder( |
| 378 controllers, |
| 379 std::vector<ControllerType>{ControllerType::CHANNEL, ControllerType::DTX, |
| 380 ControllerType::BIT_RATE}); |
| 381 } |
| 382 |
362 TEST(ControllerManagerTest, CreateFromConfigStringAndCheckReordering) { | 383 TEST(ControllerManagerTest, CreateFromConfigStringAndCheckReordering) { |
363 rtc::ScopedFakeClock fake_clock; | 384 rtc::ScopedFakeClock fake_clock; |
364 audio_network_adaptor::config::ControllerManager config; | 385 audio_network_adaptor::config::ControllerManager config; |
365 config.set_min_reordering_time_ms(kMinReorderingTimeMs); | 386 config.set_min_reordering_time_ms(kMinReorderingTimeMs); |
366 config.set_min_reordering_squared_distance(kMinReorderingSquareDistance); | 387 config.set_min_reordering_squared_distance(kMinReorderingSquareDistance); |
367 | 388 |
368 AddChannelControllerConfig(&config); | 389 AddChannelControllerConfig(&config); |
369 | 390 |
370 // Internally associated with characteristic point 0. | 391 // Internally associated with characteristic point 0. |
371 AddFecControllerConfig(&config); | 392 AddFecControllerConfig(&config); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // Reorder now. | 435 // Reorder now. |
415 CheckControllersOrder(controllers, | 436 CheckControllersOrder(controllers, |
416 std::vector<ControllerType>{ | 437 std::vector<ControllerType>{ |
417 ControllerType::FRAME_LENGTH, ControllerType::FEC, | 438 ControllerType::FRAME_LENGTH, ControllerType::FEC, |
418 ControllerType::CHANNEL, ControllerType::DTX, | 439 ControllerType::CHANNEL, ControllerType::DTX, |
419 ControllerType::BIT_RATE}); | 440 ControllerType::BIT_RATE}); |
420 } | 441 } |
421 #endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP | 442 #endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP |
422 | 443 |
423 } // namespace webrtc | 444 } // namespace webrtc |
OLD | NEW |