Shaka Packager SDK
mock_mpd_builder.cc
1 // Copyright 2023 Google LLC. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #include <packager/mpd/base/mock_mpd_builder.h>
8 
9 #include <packager/mpd/base/media_info.pb.h>
10 
11 namespace shaka {
12 namespace {
13 const char kEmptyLang[] = "";
14 const MpdOptions kDefaultMpdOptions;
15 } // namespace
16 
17 // Doesn't matter what values get passed to the super class' constructor.
18 // All methods used for testing should be mocked.
19 MockMpdBuilder::MockMpdBuilder() : MpdBuilder(kDefaultMpdOptions) {}
20 MockMpdBuilder::~MockMpdBuilder() {}
21 
22 MockPeriod::MockPeriod(uint32_t period_id, double start_time_in_seconds)
23  : Period(period_id,
24  start_time_in_seconds,
25  kDefaultMpdOptions,
26  &sequence_counter_) {}
27 
28 MockAdaptationSet::MockAdaptationSet()
29  : AdaptationSet(kEmptyLang, kDefaultMpdOptions, &sequence_counter_) {}
30 
31 MockAdaptationSet::~MockAdaptationSet() {}
32 
33 MockRepresentation::MockRepresentation(uint32_t representation_id)
34  : Representation(MediaInfo(),
35  kDefaultMpdOptions,
36  representation_id,
37  std::unique_ptr<RepresentationStateChangeListener>()) {}
38 MockRepresentation::~MockRepresentation() {}
39 
40 } // namespace shaka
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66