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

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

Issue 1300013002: 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
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..f5290ca1c61c74a27216d0bc5c39e7452dbfa230 100644
--- a/media/formats/mp4/track_run_iterator_unittest.cc
+++ b/media/formats/mp4/track_run_iterator_unittest.cc
@@ -6,11 +6,15 @@
#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.
static const int kSumAscending1 = 45;
@@ -49,13 +53,21 @@ static const uint8 kFragmentCencSampleGroupKeyId[] = {
namespace media {
namespace mp4 {
+#define CONTAINS_STRING(arg, x) (std::string::npos != (arg).find(x))
+
+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 +401,7 @@ TEST_F(TrackRunIteratorTest, FirstSampleFlagTest) {
// Verify that parsing fails if a reserved value is in the sample flags.
TEST_F(TrackRunIteratorTest, SampleInfoTest_ReservedInSampleFlags) {
+ EXPECT_MEDIA_LOG_STRING(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 +412,7 @@ TEST_F(TrackRunIteratorTest, SampleInfoTest_ReservedInSampleFlags) {
// Verify that parsing fails if a reserved value is in the default sample flags.
TEST_F(TrackRunIteratorTest, SampleInfoTest_ReservedInDefaultSampleFlags) {
+ EXPECT_MEDIA_LOG_STRING(ReservedValueInSampleDependencyInfo());
iter_.reset(new TrackRunIterator(&moov_, media_log_));
MovieFragment moof = CreateFragment();
// Set the default flag to contain a reserved "depends on" value.

Powered by Google App Engine
This is Rietveld 408576698