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

Unified Diff: media/base/android/media_url_demuxer_unittest.cc

Issue 2090343004: Add GetUrl to DemuxerStreamProvider interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/base/android/media_url_demuxer_unittest.cc
diff --git a/media/base/android/media_url_demuxer_unittest.cc b/media/base/android/media_url_demuxer_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..914dc02e5d4c3ec3944f778416827d3af02fa045
--- /dev/null
+++ b/media/base/android/media_url_demuxer_unittest.cc
@@ -0,0 +1,44 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/macros.h"
+#include "base/message_loop/message_loop.h"
+#include "media/base/android/media_url_demuxer.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace media {
+
+class MediaUrlDemuxerTest : public testing::Test {
+ public:
+ MediaUrlDemuxerTest() {}
+
+ void Initialize(const GURL& gurl) {
+ demuxer_.reset(new MediaUrlDemuxer(gurl));
+ }
+
+ void Initialize() { Initialize(GURL(kDefaultUrl)); }
+
+ const std::string kDefaultUrl = "http://example.com/";
DaleCurtis 2016/06/24 23:29:11 Could just make this a GURL and avoid the GURL(...
tguilbert 2016/06/25 01:15:48 Somewhat changed the UTs in this last patch.
+
+ std::unique_ptr<Demuxer> demuxer_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MediaUrlDemuxerTest);
+};
+
+TEST_F(MediaUrlDemuxerTest, NormalCase) {
+ Initialize();
+
+ EXPECT_EQ(DemuxerStreamProvider::Type::URL, demuxer_->GetType());
+ EXPECT_EQ(kDefaultUrl, demuxer_->GetUrl().spec());
+}
+
+TEST_F(MediaUrlDemuxerTest, AcceptsEmptyStrings) {
+ Initialize(GURL());
+
+ EXPECT_EQ(GURL::EmptyGURL(), demuxer_->GetUrl());
+}
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698