/src/mozilla-central/dom/media/gtest/TestBlankVideoDataCreator.cpp
Line | Count | Source (jump to first uncovered line) |
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 |
4 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | | |
6 | | #include "gtest/gtest.h" |
7 | | #include "BlankDecoderModule.h" |
8 | | |
9 | | using namespace mozilla; |
10 | | |
11 | | TEST(BlankVideoDataCreator, ShouldNotOverflow) |
12 | 0 | { |
13 | 0 | RefPtr<MediaRawData> mrd = new MediaRawData(); |
14 | 0 | const uint32_t width = 1; |
15 | 0 | const uint32_t height = 1; |
16 | 0 | BlankVideoDataCreator creater(width, height, nullptr); |
17 | 0 | RefPtr<MediaData> data = creater.Create(mrd); |
18 | 0 | EXPECT_NE(data.get(), nullptr); |
19 | 0 | } |
20 | | |
21 | | TEST(BlankVideoDataCreator, ShouldOverflow) |
22 | 0 | { |
23 | 0 | RefPtr<MediaRawData> mrd = new MediaRawData(); |
24 | 0 | const uint32_t width = UINT_MAX; |
25 | 0 | const uint32_t height = UINT_MAX; |
26 | 0 | BlankVideoDataCreator creater(width, height, nullptr); |
27 | 0 | RefPtr<MediaData> data = creater.Create(mrd); |
28 | 0 | EXPECT_EQ(data.get(), nullptr); |
29 | 0 | } |