Bug 1772053 - Enable dynamic code disable mitigations only on Windows 10 1703+ r...
[gecko.git] / dom / media / gtest / TestDecoderBenchmark.cpp
blob85091a49468faec0cddf3202bd74ccd998860044
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "DecoderBenchmark.h"
8 #include "gmock/gmock.h"
9 #include "gtest/gtest-printers.h"
10 #include "gtest/gtest.h"
12 using ::testing::Return;
13 using namespace mozilla;
15 TEST(DecoderBenchmark, CreateKey)
17 DecoderBenchmarkInfo info{"video/av1"_ns, 1, 1, 1, 8};
18 EXPECT_EQ(KeyUtil::CreateKey(info),
19 "ResolutionLevel0-FrameRateLevel0-8bit"_ns)
20 << "Min level";
22 DecoderBenchmarkInfo info1{"video/av1"_ns, 5000, 5000, 100, 8};
23 EXPECT_EQ(KeyUtil::CreateKey(info1),
24 "ResolutionLevel7-FrameRateLevel4-8bit"_ns)
25 << "Max level";
27 DecoderBenchmarkInfo info2{"video/av1"_ns, 854, 480, 30, 8};
28 EXPECT_EQ(KeyUtil::CreateKey(info2),
29 "ResolutionLevel3-FrameRateLevel2-8bit"_ns)
30 << "On the top of 4th resolution level";
32 DecoderBenchmarkInfo info3{"video/av1"_ns, 1270, 710, 24, 8};
33 EXPECT_EQ(KeyUtil::CreateKey(info3),
34 "ResolutionLevel4-FrameRateLevel1-8bit"_ns)
35 << "Closer to 5th resolution level - bellow";
37 DecoderBenchmarkInfo info4{"video/av1"_ns, 1290, 730, 24, 8};
38 EXPECT_EQ(KeyUtil::CreateKey(info4),
39 "ResolutionLevel4-FrameRateLevel1-8bit"_ns)
40 << "Closer to 5th resolution level - above";
42 DecoderBenchmarkInfo info5{"video/av1"_ns, 854, 480, 20, 8};
43 EXPECT_EQ(KeyUtil::CreateKey(info5),
44 "ResolutionLevel3-FrameRateLevel1-8bit"_ns)
45 << "Closer to 2nd frame rate level - bellow";
47 DecoderBenchmarkInfo info6{"video/av1"_ns, 854, 480, 26, 8};
48 EXPECT_EQ(KeyUtil::CreateKey(info6),
49 "ResolutionLevel3-FrameRateLevel1-8bit"_ns)
50 << "Closer to 2nd frame rate level - above";
52 DecoderBenchmarkInfo info7{"video/av1"_ns, 1280, 720, 24, 10};
53 EXPECT_EQ(KeyUtil::CreateKey(info7),
54 "ResolutionLevel4-FrameRateLevel1-non8bit"_ns)
55 << "Bit depth 10 bits";
57 DecoderBenchmarkInfo info8{"video/av1"_ns, 1280, 720, 24, 12};
58 EXPECT_EQ(KeyUtil::CreateKey(info8),
59 "ResolutionLevel4-FrameRateLevel1-non8bit"_ns)
60 << "Bit depth 12 bits";
62 DecoderBenchmarkInfo info9{"video/av1"_ns, 1280, 720, 24, 16};
63 EXPECT_EQ(KeyUtil::CreateKey(info9),
64 "ResolutionLevel4-FrameRateLevel1-non8bit"_ns)
65 << "Bit depth 16 bits";