summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2010-09-10 12:48:00 -0700
committerWu-cheng Li <wuchengli@google.com>2010-09-15 09:21:49 -0700
commit4aaa2130af7241f128ee561cafd17a4fb560b92c (patch)
tree0d92d61f352c0605a2fdaa63c909e4f2edd3a55d /tests
parent8eaa6919f0d5c10c95c99f2f937d57ea5c4a5bba (diff)
downloadLegacyCamera-4aaa2130af7241f128ee561cafd17a4fb560b92c.zip
LegacyCamera-4aaa2130af7241f128ee561cafd17a4fb560b92c.tar.gz
LegacyCamera-4aaa2130af7241f128ee561cafd17a4fb560b92c.tar.bz2
Fix the wrong rotation on naturally landscape devices.
The orientation of on-screen icons and thumbnails are wrong on devices that are naturally landscape in their orientation. Display.getRotation should be used to compensate. Parameters.setRotation should also be compensated by camera's orientation. Change-Id: Ia0684fcd606252c49fa2d701ab07c73f7e29b70b
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/camera/UnitTests.java4
-rw-r--r--tests/src/com/android/camera/unittest/CameraTest.java26
2 files changed, 28 insertions, 2 deletions
diff --git a/tests/src/com/android/camera/UnitTests.java b/tests/src/com/android/camera/UnitTests.java
index aeed001..4fc0e7d 100644
--- a/tests/src/com/android/camera/UnitTests.java
+++ b/tests/src/com/android/camera/UnitTests.java
@@ -28,8 +28,8 @@ public class UnitTests extends TestSuite {
public static Test suite() {
return new UnitTestSuiteBuilder(UnitTests.class)
- .includeAllPackagesUnderHere()
- .excludePackages("com.android.camera.stress")
+ .includePackages("com.android.camera.unittest",
+ "com.android.camera.gallery")
.named("Camera Unit Tests")
.build();
}
diff --git a/tests/src/com/android/camera/unittest/CameraTest.java b/tests/src/com/android/camera/unittest/CameraTest.java
new file mode 100644
index 0000000..0e851e4
--- /dev/null
+++ b/tests/src/com/android/camera/unittest/CameraTest.java
@@ -0,0 +1,26 @@
+package com.android.camera.unittest;
+
+import com.android.camera.Camera;
+
+import android.test.suitebuilder.annotation.SmallTest;
+
+import junit.framework.TestCase;
+
+@SmallTest
+public class CameraTest extends TestCase {
+ public void testRoundOrientation() {
+ assertEquals(0, Camera.roundOrientation(0));
+ assertEquals(0, Camera.roundOrientation(0 + 44));
+ assertEquals(90, Camera.roundOrientation(0 + 45));
+ assertEquals(90, Camera.roundOrientation(90));
+ assertEquals(90, Camera.roundOrientation(90 + 44));
+ assertEquals(180, Camera.roundOrientation(90 + 45));
+ assertEquals(180, Camera.roundOrientation(180));
+ assertEquals(180, Camera.roundOrientation(180 + 44));
+ assertEquals(270, Camera.roundOrientation(180 + 45));
+ assertEquals(270, Camera.roundOrientation(270));
+ assertEquals(270, Camera.roundOrientation(270 + 44));
+ assertEquals(0, Camera.roundOrientation(270 + 45));
+ assertEquals(0, Camera.roundOrientation(359));
+ }
+}