Files
rk35xx-android14/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/MetricsTest.java
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

44 lines
1.3 KiB
Java

package com.android.documentsui;
import android.content.Intent;
import android.net.Uri;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
import com.android.documentsui.base.Providers;
import com.android.documentsui.base.State;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Tests for the specialized behaviors provided by Metrics.
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
public class MetricsTest {
@Test
public void logActivityLaunch_storageAuthority_shouldNotCrash() {
final Intent intent = new Intent(null, Uri.parse(
"content://" + Providers.AUTHORITY_STORAGE + "/document/primary:"));
final State state = new State();
state.action = State.ACTION_BROWSE;
Metrics.logActivityLaunch(state, intent);
}
@Test
public void logActivityLaunch_mediaAuthority_shouldNotCrash() {
final Intent intent = new Intent(null, Uri.parse(
"content://" + Providers.AUTHORITY_MEDIA + "/document/primary:"));
final State state = new State();
state.action = State.ACTION_BROWSE;
Metrics.logActivityLaunch(state, intent);
}
@Test
public void logDragInitiated_shouldNotCrash() {
Metrics.logDragInitiated(true);
}
}