blob: cdf67a96aabc00bc9a8977cd48c7745631456f94 [file] [log] [blame]
felkachangec40c5c2018-05-14 18:01:11 +08001package com.android.documentsui;
2
felkachangec40c5c2018-05-14 18:01:11 +08003import android.content.Intent;
4import android.net.Uri;
Brett Chabot2027ca02018-12-13 19:06:31 -08005
6import androidx.test.InstrumentationRegistry;
7import androidx.test.filters.SmallTest;
8import androidx.test.runner.AndroidJUnit4;
felkachangec40c5c2018-05-14 18:01:11 +08009
10import com.android.documentsui.base.Providers;
11import com.android.documentsui.base.State;
12
13import org.junit.Test;
14import org.junit.runner.RunWith;
15
16/**
17 * Tests for the specialized behaviors provided by Metrics.
18 */
19@RunWith(AndroidJUnit4.class)
20@SmallTest
21public class MetricsTest {
22 @Test
23 public void logActivityLaunch_storageAuthority_shouldNotCrash() {
24 final Intent intent = new Intent(null, Uri.parse(
25 "content://" + Providers.AUTHORITY_STORAGE + "/document/primary:"));
26 final State state = new State();
27 state.action = State.ACTION_BROWSE;
shawnlin9cee68f2019-01-25 11:20:18 +080028 Metrics.logActivityLaunch(state, intent);
felkachangec40c5c2018-05-14 18:01:11 +080029 }
30
31 @Test
32 public void logActivityLaunch_mediaAuthority_shouldNotCrash() {
33 final Intent intent = new Intent(null, Uri.parse(
34 "content://" + Providers.AUTHORITY_MEDIA + "/document/primary:"));
35 final State state = new State();
36 state.action = State.ACTION_BROWSE;
shawnlin9cee68f2019-01-25 11:20:18 +080037 Metrics.logActivityLaunch(state, intent);
felkachangec40c5c2018-05-14 18:01:11 +080038 }
39}