From 953d04dfa2aab4b7ed5b3af25850f4cf2813d869 Mon Sep 17 00:00:00 2001 From: Alex Johnston Date: Wed, 31 Mar 2021 17:28:35 +0100 Subject: [PATCH] QS work profile network logging test Bug: 183606908 Test: atest com.android.systemui.qs.QSSecurityFooterTest Change-Id: I1f6ffb72285fb7cf9542f2331897c61aec60ef8a --- .../android/systemui/qs/QSSecurityFooterTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSSecurityFooterTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSSecurityFooterTest.java index 5422ae831de36..e4b95af1af045 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSSecurityFooterTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSSecurityFooterTest.java @@ -196,7 +196,7 @@ public class QSSecurityFooterTest extends SysuiTestCase { } @Test - public void testNetworkLoggingEnabled() { + public void testNetworkLoggingEnabled_deviceOwner() { when(mSecurityController.isDeviceManaged()).thenReturn(true); when(mSecurityController.isNetworkLoggingEnabled()).thenReturn(true); mFooter.refreshState(); @@ -221,6 +221,18 @@ public class QSSecurityFooterTest extends SysuiTestCase { mFooterText.getText()); } + @Test + public void testNetworkLoggingEnabled_managedProfileOwner() { + when(mSecurityController.hasWorkProfile()).thenReturn(true); + when(mSecurityController.isNetworkLoggingEnabled()).thenReturn(true); + mFooter.refreshState(); + + TestableLooper.get(this).processAllMessages(); + assertEquals(mContext.getString( + R.string.quick_settings_disclosure_managed_profile_network_activity), + mFooterText.getText()); + } + @Test public void testManagedCACertsInstalled() { when(mSecurityController.isDeviceManaged()).thenReturn(true);