Chromium Code Reviews| 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 |