Integrate QrCode Camera with WifiDppQrCodeScannerFragment

Bug: 118797380
Test: RunSettingsRoboTests
Change-Id: I328bebbbcf44136df2c18ca1929a5da377a0cf6b
This commit is contained in:
Johnson Lu
2018-11-28 15:31:16 +08:00
parent 0173c5f532
commit a558c01696
6 changed files with 189 additions and 21 deletions

View File

@@ -24,6 +24,7 @@ import static com.google.common.truth.Truth.assertThat;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
@@ -53,4 +54,12 @@ public class WifiDppQrCodeScannerFragmentTest {
assertThat(mActivityRule.getActivityResult().getResultCode()).
isEqualTo(Activity.RESULT_CANCELED);
}
@Test
public void rotateScreen_shouldNotCrash() {
mActivityRule.getActivity().setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
mActivityRule.getActivity().setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
}