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/"; | |
| 24 | |
| 25 std::unique_ptr<Demuxer> demuxer_; | |
| 26 | |
| 27 private: | |
| 28 DISALLOW_COPY_AND_ASSIGN(MediaUrlDemuxerTest); | |
| 29 }; | |
| 30 | |
| 31 TEST_F(MediaUrlDemuxerTest, ReturnsExpectedDemuxerStreamProviderType) { | |
| 32 Initialize(); | |
| 33 | |
| 34 // Make sure the Demuxer's type is URL. | |
| 35 ASSERT_EQ(DemuxerStreamProvider::Type::URL, demuxer_->type()); | |
|
DaleCurtis
2016/06/24 22:02:40
Prefer expect_eq unless the test truly can't proce
tguilbert
2016/06/24 23:21:47
Done.
| |
| 36 } | |
| 37 | |
| 38 TEST_F(MediaUrlDemuxerTest, AcceptsNormalUrl) { | |
| 39 Initialize(); | |
| 40 | |
| 41 GURL url = demuxer_->GetUrl(); | |
| 42 | |
| 43 ASSERT_EQ(kDefaultUrl, url.spec()); | |
| 44 } | |
| 45 | |
| 46 TEST_F(MediaUrlDemuxerTest, AcceptsEmptyStrings) { | |
| 47 Initialize(GURL()); | |
| 48 | |
|
DaleCurtis
2016/06/24 22:02:40
Condense to EXPECT_EQ(GURL::EmptyGURL(), demuxer_-
tguilbert
2016/06/24 23:21:47
Done.
| |
| 49 GURL url = demuxer_->GetUrl(); | |
| 50 | |
| 51 ASSERT_EQ(GURL::EmptyGURL(), url); | |
| 52 } | |
| 53 | |
| 54 TEST_F(MediaUrlDemuxerTest, VerifyIdempotenceOfGetUrl) { | |
|
DaleCurtis
2016/06/24 22:02:40
I don't think this test does anything? :)
tguilbert
2016/06/24 23:21:47
You are right, I didn't update this :)
(When it wa
| |
| 55 Initialize(); | |
| 56 | |
| 57 GURL url = demuxer_->GetUrl(); | |
| 58 GURL url_clone = demuxer_->GetUrl(); | |
| 59 | |
| 60 ASSERT_EQ(url, url_clone); | |
| 61 } | |
| 62 | |
| 63 } // namespace media | |
| OLD | NEW |