Fix for testBadSurfaceDimensions

This test failed with device which has 480x320 LCD and vga Camera.
Frameworks gave closest match as 640x480 and so preview size is set to
640x480 but since it checking with mOrderedPreviewSizes, corresponding
size is not there and so it is asserting lie below
mOrderedPreviewSizes.contains(actualSize)

Change-Id: Id6a5f6285dbf22d22d56bc924a204d4721103a7a
diff --git a/tests/tests/hardware/src/android/hardware/camera2/cts/RobustnessTest.java b/tests/tests/hardware/src/android/hardware/camera2/cts/RobustnessTest.java
index abc0fea..7dbe859 100644
--- a/tests/tests/hardware/src/android/hardware/camera2/cts/RobustnessTest.java
+++ b/tests/tests/hardware/src/android/hardware/camera2/cts/RobustnessTest.java
@@ -69,10 +69,13 @@
                 Log.i(TAG, "Testing Camera " + id);
                 openDevice(id);
 
+                List<Size> testSizes = CameraTestUtils.getSortedSizesForFormat(id, mCameraManager,
+                        ImageFormat.YUV_420_888, null);
+
                 // Find some size not supported by the camera
                 Size weirdSize = new Size(643, 577);
                 int count = 0;
-                while(mOrderedPreviewSizes.contains(weirdSize)) {
+                while(testSizes.contains(weirdSize)) {
                     // Really, they can't all be supported...
                     weirdSize = new Size(weirdSize.getWidth() + 1, weirdSize.getHeight() + 1);
                     count++;
@@ -126,7 +129,7 @@
                 Size actualSize = new Size(imageWidth, imageHeight);
 
                 assertTrue("Camera does not contain outputted image resolution " + actualSize,
-                        mOrderedPreviewSizes.contains(actualSize));
+                        testSizes.contains(actualSize));
             } finally {
                 closeDevice(id);
             }