diff --git a/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/common/ViewsTest.java b/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/common/ViewsTest.java index 9c4f7044a..ce5325c68 100644 --- a/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/common/ViewsTest.java +++ b/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/common/ViewsTest.java @@ -21,9 +21,15 @@ import com.google.android.apps.mytracks.fragments.MyTracksMapFragment; import com.google.android.maps.mytracks.R; import android.app.Instrumentation; +import android.graphics.Point; import android.test.ActivityInstrumentationTestCase2; +import android.util.Log; +import android.view.Display; +import android.view.View; import android.widget.TextView; +import junit.framework.Assert; + /** * Tests switching views and the menu list of each view. * @@ -109,6 +115,60 @@ public class ViewsTest extends ActivityInstrumentationTestCase2 height) { + Assert.assertTrue(controller.getWidth() < controller.getHeight()); + Assert.assertTrue(controller.getTop() < height / 2); + Assert.assertTrue(controller.getRight() < width / 2); + } + + // In portrait view + else { + Assert.assertTrue(controller.getWidth() > controller.getHeight()); + Log.i(EndToEndTestUtils.LOG_TAG, controller.getTop() + ":" + controller.getRight()); + + Assert.assertTrue(controller.getTop() > height / 2); + Assert.assertTrue(controller.getRight() > width / 2); + } + } + @Override protected void tearDown() throws Exception { EndToEndTestUtils.SOLO.finishOpenedActivities();