diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-08-22 19:05:18 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-08-23 22:21:25 +0800 |
commit | d480002ccad05cf992c628c72884091c36cc654c (patch) | |
tree | a0c4c78582a5211085213b5a0c622ad198199061 /tests | |
parent | e8b7ae993fcd192aa3460540e7f3a66f601a93b1 (diff) | |
download | LegacyCamera-d480002ccad05cf992c628c72884091c36cc654c.zip LegacyCamera-d480002ccad05cf992c628c72884091c36cc654c.tar.gz LegacyCamera-d480002ccad05cf992c628c72884091c36cc654c.tar.bz2 |
Refactor all focus code to a separate class.
The code about focus is complicated and scattered around.
Move the code to a new class, so it is easier to maintain.
Change-Id: I0214b405bf1596d967e7d89cdb04328322c6ab95
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/camera/unittest/CameraTest.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/src/com/android/camera/unittest/CameraTest.java b/tests/src/com/android/camera/unittest/CameraTest.java index 1e17635..b4bd632 100644 --- a/tests/src/com/android/camera/unittest/CameraTest.java +++ b/tests/src/com/android/camera/unittest/CameraTest.java @@ -17,6 +17,7 @@ package com.android.camera.unittest; import com.android.camera.Camera; +import com.android.camera.FocusManager; import com.android.camera.Util; import android.graphics.Matrix; @@ -46,17 +47,17 @@ public class CameraTest extends TestCase { public void testConvertToFocusArea() { Rect rect = new Rect(); - Camera.convertToFocusArea(0, 0, 100, 100, 800, 480, rect); + FocusManager.convertToFocusArea(0, 0, 100, 100, 800, 480, rect); assertEquals(new Rect(-1000, -1000, -750, -583), rect); - Camera.convertToFocusArea(0, 0, 400, 240, 800, 480, rect); + FocusManager.convertToFocusArea(0, 0, 400, 240, 800, 480, rect); assertEquals(new Rect(-1000, -1000, 0, 0), rect); - Camera.convertToFocusArea(400, 240, 400, 240, 800, 480, rect); + FocusManager.convertToFocusArea(400, 240, 400, 240, 800, 480, rect); assertEquals(new Rect(0, 0, 1000, 1000), rect); - Camera.convertToFocusArea(200, 120, 400, 240, 800, 480, rect); + FocusManager.convertToFocusArea(200, 120, 400, 240, 800, 480, rect); assertEquals(new Rect(-500, -500, 500, 500), rect); - Camera.convertToFocusArea(0, 0, 800, 480, 800, 480, rect); + FocusManager.convertToFocusArea(0, 0, 800, 480, 800, 480, rect); assertEquals(new Rect(-1000, -1000, 1000, 1000), rect); - Camera.convertToFocusArea(860, 620, 100, 100, 960, 720, rect); + FocusManager.convertToFocusArea(860, 620, 100, 100, 960, 720, rect); assertEquals(new Rect(792, 722, 1000, 1000), rect); } |