NotificationViewWrapperTest.java revision 7c68e29171dca0cb2a914a9c701707d5c562cb03
1/* 2 * Copyright (C) 2017 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 17package com.android.systemui.statusbar.notification; 18 19import android.content.Context; 20import android.support.test.InstrumentationRegistry; 21import android.support.test.runner.AndroidJUnit4; 22import android.view.View; 23 24import com.android.systemui.statusbar.ExpandableNotificationRow; 25 26import org.junit.Before; 27import org.junit.Test; 28import org.junit.runner.RunWith; 29 30@RunWith(AndroidJUnit4.class) 31public class NotificationViewWrapperTest { 32 33 private Context mContext; 34 35 @Before 36 public void setUp() throws Exception { 37 mContext = InstrumentationRegistry.getTargetContext(); 38 } 39 40 @Test 41 public void constructor_doesntUseViewContext() throws Exception { 42 new TestableNotificationViewWrapper(mContext, new View(null /* context */), null /* row */); 43 } 44 45 static class TestableNotificationViewWrapper extends NotificationViewWrapper { 46 protected TestableNotificationViewWrapper(Context ctx, View view, 47 ExpandableNotificationRow row) { 48 super(ctx, view, row); 49 } 50 } 51}