From 5ee552193b3e07218c94d3a8d8569107b012f319 Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Tue, 21 Feb 2017 18:03:26 -0800 Subject: [PATCH] Test for AsssitSettingObserver Change-Id: I4896a097cd9d898829be04098b6e31766af39c7a Fix: 35641857 Test: make RunSettingRoboTests --- .../assist/AssistSettingObserverTest.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/robotests/src/com/android/settings/applications/assist/AssistSettingObserverTest.java diff --git a/tests/robotests/src/com/android/settings/applications/assist/AssistSettingObserverTest.java b/tests/robotests/src/com/android/settings/applications/assist/AssistSettingObserverTest.java new file mode 100644 index 00000000000..abc030bc6ec --- /dev/null +++ b/tests/robotests/src/com/android/settings/applications/assist/AssistSettingObserverTest.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.settings.applications.assist; + + +import android.net.Uri; + +import com.android.settings.SettingsRobolectricTestRunner; +import com.android.settings.TestConfig; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.annotation.Config; + +import java.util.List; + +@RunWith(SettingsRobolectricTestRunner.class) +@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) +public class AssistSettingObserverTest { + + private AssistSettingObserver mObserver; + + @Test + public void callConstructor_shouldNotCrash() { + mObserver = new AssistSettingObserver() { + @Override + protected List getSettingUris() { + return null; + } + + @Override + public void onSettingChange() { + + } + }; + } + +}