2 * Copyright (C) 2019 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.android.systemui.glwallpaper;
19 import static org.junit.Assert.*;
20 import static org.mockito.Mockito.RETURNS_DEFAULTS;
21 import static org.mockito.Mockito.mock;
23 import android.testing.AndroidTestingRunner;
24 import android.testing.TestableLooper;
25 import android.view.SurfaceHolder;
27 import androidx.test.filters.SmallTest;
29 import com.android.systemui.SysuiTestCase;
31 import org.junit.Before;
32 import org.junit.Test;
33 import org.junit.runner.RunWith;
34 import org.mockito.Mock;
38 @RunWith(AndroidTestingRunner.class)
39 @TestableLooper.RunWithLooper
40 public class EglHelperTest extends SysuiTestCase {
43 private EglHelper mEglHelper;
45 private SurfaceHolder mSurfaceHolder;
48 public void setUp() throws Exception {
49 mEglHelper = mock(EglHelper.class, RETURNS_DEFAULTS);
50 mSurfaceHolder = mock(SurfaceHolder.class, RETURNS_DEFAULTS);
54 public void testInit_finish() {
55 mEglHelper.init(mSurfaceHolder);
60 public void testFinish_shouldNotCrash() {
61 assertFalse(mEglHelper.hasEglDisplay());
62 assertFalse(mEglHelper.hasEglSurface());
63 assertFalse(mEglHelper.hasEglContext());