Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/macros.h" | |
| 6 #include "base/message_loop/message_loop.h" | |
| 7 #include "media/base/android/media_url_demuxer.h" | |
| 8 #include "testing/gmock/include/gmock/gmock.h" | |
| 9 #include "testing/gtest/include/gtest/gtest.h" | |
| 10 | |
| 11 namespace media { | |
| 12 | |
| 13 class MediaUrlDemuxerTest : public testing::Test { | |
| 14 public: | |
| 15 MediaUrlDemuxerTest() {} | |
| 16 | |
| 17 void Initialize(const GURL& gurl) { | |
| 18 demuxer_.reset(new MediaUrlDemuxer(gurl)); | |
| 19 } | |
| 20 | |
| 21 void Initialize() { Initialize(GURL(kDefaultUrl)); } | |
| 22 | |
| 23 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.
| |
| 24 | |
| 25 std::unique_ptr<Demuxer> demuxer_; | |
| 26 | |
| 27 private: | |
| 28 DISALLOW_COPY_AND_ASSIGN(MediaUrlDemuxerTest); | |
| 29 }; | |
| 30 | |
| 31 TEST_F(MediaUrlDemuxerTest, NormalCase) { | |
| 32 Initialize(); | |
| 33 | |
| 34 EXPECT_EQ(DemuxerStreamProvider::Type::URL, demuxer_->GetType()); | |
| 35 EXPECT_EQ(kDefaultUrl, demuxer_->GetUrl().spec()); | |
| 36 } | |
| 37 | |
| 38 TEST_F(MediaUrlDemuxerTest, AcceptsEmptyStrings) { | |
| 39 Initialize(GURL()); | |
| 40 | |
| 41 EXPECT_EQ(GURL::EmptyGURL(), demuxer_->GetUrl()); | |
| 42 } | |
| 43 | |
| 44 } // namespace media | |
| OLD | NEW |