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

Side by Side 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698