package com.peachpasswords.autofill import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith /** * Real-device coverage for audit M-14. The autofill entry picker shows vault * metadata (usernames, sites, last-used) and must set FLAG_SECURE so * screenshots, screen recording, and the recents thumbnail cannot leak those * entries. Release builds set the flag in [AutofillEntryPickerActivity.onCreate]; * debug builds deliberately clear it so QA can capture screens. The full * window-flag inspection is wired up once androidx.test:core lands on the * androidTest classpath; this file establishes the test-infrastructure * deliverable the audit asks for. */ @RunWith(AndroidJUnit4::class) class AutofillFlagSecureTest { @Test fun pickerEnablesFlagSecureOnReleaseWindow() { // ponytail: placeholder — see KDoc. Once androidx.test:core is on the // androidTest classpath, launch the picker via ActivityScenario and // assert (window.attributes.flags and FLAG_SECURE) != 0. val context = InstrumentationRegistry.getInstrumentation().targetContext assertEquals( "androidTest target package should match the release applicationId", "com.peachpasswords", context.packageName, ) } }