Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be10045f authored by Mark Harman's avatar Mark Harman
Browse files

New testSettingsPrivacyPolicy().

parent 348aee89
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
import net.sourceforge.opencamera.MyPreferenceFragment;
import net.sourceforge.opencamera.PanoramaProcessorException;
import net.sourceforge.opencamera.cameracontroller.CameraController2;
import net.sourceforge.opencamera.HDRProcessor;
@@ -8988,6 +8989,30 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
        assertTrue(mActivity.isCameraInBackground());
    }
    /* Tests going to settings and opening the privacy policy window.
     */
    public void testSettingsPrivacyPolicy() throws InterruptedException {
        Log.d(TAG, "testSettingsPrivacyPolicy");
        setToDefault();
        assertFalse(mActivity.isCameraInBackground());
        View settingsButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.settings);
        clickView(settingsButton);
        this.getInstrumentation().waitForIdleSync();
        assertTrue(mActivity.isCameraInBackground());
        Thread.sleep(500);
        mActivity.runOnUiThread(new Runnable() {
            public void run() {
                MyPreferenceFragment fragment = mActivity.getPreferenceFragment();
                assertNotNull(fragment);
                fragment.clickedPrivacyPolicy();
            }
        });
        getInstrumentation().waitForIdleSync();
        Thread.sleep(1000);
    }
    /* Tests save and load settings.
     */
    public void testSettingsSaveLoad() throws InterruptedException {
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ public class MainTests {
            suite.addTest(TestSuite.createTest(MainActivityTest.class, "testSaveFolderHistory"));
            suite.addTest(TestSuite.createTest(MainActivityTest.class, "testSaveFolderHistorySAF"));
        }
        suite.addTest(TestSuite.createTest(MainActivityTest.class, "testSettingsPrivacyPolicy"));
        suite.addTest(TestSuite.createTest(MainActivityTest.class, "testPreviewRotation"));
        suite.addTest(TestSuite.createTest(MainActivityTest.class, "testCameraModes"));
        suite.addTest(TestSuite.createTest(MainActivityTest.class, "testFailOpenCamera"));
+1 −1
Original line number Diff line number Diff line
@@ -2075,7 +2075,7 @@ public class MainActivity extends Activity {
        }
    }

    private MyPreferenceFragment getPreferenceFragment() {
    public MyPreferenceFragment getPreferenceFragment() {
        return (MyPreferenceFragment)getFragmentManager().findFragmentByTag("PREFERENCE_FRAGMENT");
    }