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

Unified Diff: media/formats/mp4/track_run_iterator_unittest.cc

Issue 1317063003: Reland of MSE: Verify MediaLog events created by existing MP4 unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@more_mockmedialog_testing_webm
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/formats/mp4/mp4_stream_parser_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp4/track_run_iterator_unittest.cc
diff --git a/media/formats/mp4/track_run_iterator_unittest.cc b/media/formats/mp4/track_run_iterator_unittest.cc
index f9dde7204f1c169dd313739820a0743b906c2283..4eec578d67df3be4362c5a66c10f54ff27307e53 100644
--- a/media/formats/mp4/track_run_iterator_unittest.cc
+++ b/media/formats/mp4/track_run_iterator_unittest.cc
@@ -6,10 +6,14 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_split.h"
+#include "media/base/mock_media_log.h"
#include "media/formats/mp4/box_definitions.h"
#include "media/formats/mp4/rcheck.h"
#include "media/formats/mp4/track_run_iterator.h"
+#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+
+using ::testing::StrictMock;
// The sum of the elements in a vector initialized with SumAscending,
// less the value of the last element.
@@ -49,13 +53,19 @@
namespace media {
namespace mp4 {
+MATCHER(ReservedValueInSampleDependencyInfo, "") {
+ return CONTAINS_STRING(arg, "Reserved value used in sample dependency info.");
+}
+
class TrackRunIteratorTest : public testing::Test {
public:
- TrackRunIteratorTest() : media_log_(new MediaLog()) { CreateMovie(); }
+ TrackRunIteratorTest() : media_log_(new StrictMock<MockMediaLog>()) {
+ CreateMovie();
+ }
protected:
Movie moov_;
- scoped_refptr<MediaLog> media_log_;
+ scoped_refptr<StrictMock<MockMediaLog>> media_log_;
scoped_ptr<TrackRunIterator> iter_;
void CreateMovie() {
@@ -389,6 +399,7 @@
// Verify that parsing fails if a reserved value is in the sample flags.
TEST_F(TrackRunIteratorTest, SampleInfoTest_ReservedInSampleFlags) {
+ EXPECT_MEDIA_LOG(ReservedValueInSampleDependencyInfo());
iter_.reset(new TrackRunIterator(&moov_, media_log_));
MovieFragment moof = CreateFragment();
// Change the "depends on" field on one of the samples to a
@@ -399,6 +410,7 @@
// Verify that parsing fails if a reserved value is in the default sample flags.
TEST_F(TrackRunIteratorTest, SampleInfoTest_ReservedInDefaultSampleFlags) {
+ EXPECT_MEDIA_LOG(ReservedValueInSampleDependencyInfo());
iter_.reset(new TrackRunIterator(&moov_, media_log_));
MovieFragment moof = CreateFragment();
// Set the default flag to contain a reserved "depends on" value.
« no previous file with comments | « media/formats/mp4/mp4_stream_parser_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698