1 /* 2 * Copyright 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 17 package androidx.wear.ambient; 18 19 import static org.junit.Assert.assertFalse; 20 import static org.junit.Assert.assertTrue; 21 22 import android.support.test.filters.MediumTest; 23 import android.support.test.rule.ActivityTestRule; 24 import android.support.test.runner.AndroidJUnit4; 25 26 import androidx.wear.widget.util.WakeLockRule; 27 28 import com.google.android.wearable.compat.WearableActivityController; 29 30 import org.junit.Rule; 31 import org.junit.Test; 32 import org.junit.runner.RunWith; 33 34 @MediumTest 35 @RunWith(AndroidJUnit4.class) 36 public class AmbientModeResumeTest { 37 @Rule 38 public final WakeLockRule mWakeLock = new WakeLockRule(); 39 40 @Rule 41 public final ActivityTestRule<AmbientModeResumeTestActivity> mActivityRule = 42 new ActivityTestRule<>(AmbientModeResumeTestActivity.class); 43 44 @Test 45 public void testActivityDefaults() throws Throwable { 46 assertTrue(WearableActivityController.getLastInstance().isAutoResumeEnabled()); 47 assertFalse(WearableActivityController.getLastInstance().isAmbientEnabled()); 48 } 49 } 50