Bug 1296531 - Rename existing AudioTrackEncoder gtests to match TestVideoTrackEncoder. r=jesup
authorAndreas Pehrson <pehrsons@gmail.com>
Fri, 17 Feb 2017 11:40:33 +0100
changeset 382982 bb47b1aba6c72b6d03a19c0c79fcdb627347e06e
parent 382981 4458029940336f73b78fdfd2ade8c7fe00a729d8
child 382983 7ee3807be53447957980d846264ff2bc0729b996
push id52061
push userpehrsons@gmail.com
push dateTue, 26 Sep 2017 14:36:10 +0000
treeherderautoland@8448eee20c9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1296531
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1296531 - Rename existing AudioTrackEncoder gtests to match TestVideoTrackEncoder. r=jesup MozReview-Commit-ID: 6o5c35yGUL4
dom/media/gtest/TestAudioTrackEncoder.cpp
--- a/dom/media/gtest/TestAudioTrackEncoder.cpp
+++ b/dom/media/gtest/TestAudioTrackEncoder.cpp
@@ -57,25 +57,17 @@ CreateTestSegment()
 
 static bool
 TestOpusInit(int aChannels, int aSamplingRate)
 {
   TestOpusTrackEncoder encoder;
   return encoder.TestOpusCreation(aChannels, aSamplingRate);
 }
 
-static int
-TestOpusResampler(int aChannels, int aSamplingRate)
-{
-  TestOpusTrackEncoder encoder;
-  EXPECT_TRUE(encoder.TestOpusCreation(aChannels, aSamplingRate));
-  return encoder.TestGetOutputSampleRate();
-}
-
-TEST(Media, OpusEncoder_Init)
+TEST(OpusAudioTrackEncoder, Init)
 {
   // Expect false with 0 or negative channels of input signal.
   EXPECT_FALSE(TestOpusInit(0, 16000));
   EXPECT_FALSE(TestOpusInit(-1, 16000));
 
   // The Opus format supports up to 8 channels, and supports multitrack audio up
   // to 255 channels, but the current implementation supports only mono and
   // stereo, and downmixes any more than that.
@@ -96,17 +88,17 @@ TEST(Media, OpusEncoder_Init)
   EXPECT_FALSE(TestOpusInit(2, 4000));
   EXPECT_FALSE(TestOpusInit(2, 7999));
   EXPECT_TRUE(TestOpusInit(2, 8000));
   EXPECT_TRUE(TestOpusInit(2, 192000));
   EXPECT_FALSE(TestOpusInit(2, 192001));
   EXPECT_FALSE(TestOpusInit(2, 200000));
 }
 
-TEST(Media, OpusEncoder_TryInit)
+TEST(OpusAudioTrackEncoder, TryInit)
 {
   {
     // The encoder does not normally recieve enough info from null data to
     // init. However, multiple attempts to do so, with sufficiently long
     // duration segments, should result in a best effort attempt. The first
     // attempt should never do this though, even if the duration is long:
     TestOpusTrackEncoder encoder;
     AudioSegment testSegment;
@@ -159,17 +151,25 @@ TEST(Media, OpusEncoder_TryInit)
   {
     // Test high sample rate bound
     TestOpusTrackEncoder encoder;
     AudioSegment testSegment = CreateTestSegment();
     EXPECT_TRUE(encoder.TestOpusTryCreation(testSegment, 192000));
   }
 }
 
-TEST(Media, OpusEncoder_Resample)
+static int
+TestOpusResampler(int aChannels, int aSamplingRate)
+{
+  TestOpusTrackEncoder encoder;
+  EXPECT_TRUE(encoder.TestOpusCreation(aChannels, aSamplingRate));
+  return encoder.TestGetOutputSampleRate();
+}
+
+TEST(OpusAudioTrackEncoder, Resample)
 {
   // Sampling rates of data to be fed to Opus encoder, should remain unchanged
   // if it is one of Opus supported rates (8000, 12000, 16000, 24000 and 48000
   // (kHz)) at initialization.
   EXPECT_TRUE(TestOpusResampler(1, 8000) == 8000);
   EXPECT_TRUE(TestOpusResampler(1, 12000) == 12000);
   EXPECT_TRUE(TestOpusResampler(1, 16000) == 16000);
   EXPECT_TRUE(TestOpusResampler(1, 24000) == 24000);