1 /* 2 * Copyright (C) 2015 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License 15 */ 16 17 package com.android.tv; 18 19 import android.test.mock.MockApplication; 20 21 import com.android.tv.analytics.Analytics; 22 import com.android.tv.analytics.Tracker; 23 import com.android.tv.data.ChannelDataManager; 24 import com.android.tv.data.ProgramDataManager; 25 import com.android.tv.dvr.DvrDataManager; 26 import com.android.tv.dvr.DvrManager; 27 import com.android.tv.dvr.DvrSessionManager; 28 import com.android.tv.util.TvInputManagerHelper; 29 30 /** 31 * A mock TV Application used for testing. 32 */ 33 public class MockTvApplication extends MockApplication implements ApplicationSingletons { 34 public final ApplicationSingletons mDelegate; 35 36 public MockTvApplication(ApplicationSingletons delegate) { 37 mDelegate = delegate; 38 } 39 40 @Override 41 public DvrManager getDvrManager() { 42 return mDelegate.getDvrManager(); 43 } 44 45 @Override 46 public DvrSessionManager getDvrSessionManger() { 47 return mDelegate.getDvrSessionManger(); 48 } 49 50 @Override 51 public Analytics getAnalytics() { 52 return mDelegate.getAnalytics(); 53 } 54 55 @Override 56 public Tracker getTracker() { 57 return mDelegate.getTracker(); 58 } 59 60 @Override 61 public ChannelDataManager getChannelDataManager() { 62 return mDelegate.getChannelDataManager(); 63 } 64 65 @Override 66 public ProgramDataManager getProgramDataManager() { 67 return mDelegate.getProgramDataManager(); 68 } 69 70 @Override 71 public DvrDataManager getDvrDataManager() { 72 return mDelegate.getDvrDataManager(); 73 } 74 75 @Override 76 public TvInputManagerHelper getTvInputManagerHelper() { 77 return mDelegate.getTvInputManagerHelper(); 78 } 79 80 @Override 81 public MainActivityWrapper getMainActivityWrapper() { 82 return mDelegate.getMainActivityWrapper(); 83 } 84 } 85