summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2012-03-09 17:10:19 -0800
committerFabrice Di Meglio <fdimeglio@google.com>2012-03-09 17:32:16 -0800
commite8dc07dcdb983d5d3999b16c2a49ddee4bdb942c (patch)
treefa3501d60b3caee9b10a511ffa4d88c6ba57e720 /core/tests
parent3bef5e9f3aa90465ee3ab66ef33d7a88d1b0c5c1 (diff)
downloadframeworks_base-e8dc07dcdb983d5d3999b16c2a49ddee4bdb942c.zip
frameworks_base-e8dc07dcdb983d5d3999b16c2a49ddee4bdb942c.tar.gz
frameworks_base-e8dc07dcdb983d5d3999b16c2a49ddee4bdb942c.tar.bz2
Make Gravity RTL APIs public
- also move unit tests to CTS - also small improvement for View Javadoc Change-Id: I166d5a10f4a00f1b46c90468c8b11906b438e1ea
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/coretests/src/android/view/GravityTest.java74
1 files changed, 0 insertions, 74 deletions
diff --git a/core/tests/coretests/src/android/view/GravityTest.java b/core/tests/coretests/src/android/view/GravityTest.java
deleted file mode 100644
index d8ef650..0000000
--- a/core/tests/coretests/src/android/view/GravityTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.view;
-
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-public class GravityTest extends AndroidTestCase {
-
- @SmallTest
- public void testGetAbsoluteGravity() throws Exception {
- assertOneGravity(Gravity.LEFT, Gravity.LEFT, false);
- assertOneGravity(Gravity.LEFT, Gravity.LEFT, true);
-
- assertOneGravity(Gravity.RIGHT, Gravity.RIGHT, false);
- assertOneGravity(Gravity.RIGHT, Gravity.RIGHT, true);
-
- assertOneGravity(Gravity.TOP, Gravity.TOP, false);
- assertOneGravity(Gravity.TOP, Gravity.TOP, true);
-
- assertOneGravity(Gravity.BOTTOM, Gravity.BOTTOM, false);
- assertOneGravity(Gravity.BOTTOM, Gravity.BOTTOM, true);
-
- assertOneGravity(Gravity.CENTER_VERTICAL, Gravity.CENTER_VERTICAL, false);
- assertOneGravity(Gravity.CENTER_VERTICAL, Gravity.CENTER_VERTICAL, true);
-
- assertOneGravity(Gravity.CENTER_HORIZONTAL, Gravity.CENTER_HORIZONTAL, false);
- assertOneGravity(Gravity.CENTER_HORIZONTAL, Gravity.CENTER_HORIZONTAL, true);
-
- assertOneGravity(Gravity.CENTER, Gravity.CENTER, false);
- assertOneGravity(Gravity.CENTER, Gravity.CENTER, true);
-
- assertOneGravity(Gravity.FILL_VERTICAL, Gravity.FILL_VERTICAL, false);
- assertOneGravity(Gravity.FILL_VERTICAL, Gravity.FILL_VERTICAL, true);
-
- assertOneGravity(Gravity.FILL_HORIZONTAL, Gravity.FILL_HORIZONTAL, false);
- assertOneGravity(Gravity.FILL_HORIZONTAL, Gravity.FILL_HORIZONTAL, true);
-
- assertOneGravity(Gravity.FILL, Gravity.FILL, false);
- assertOneGravity(Gravity.FILL, Gravity.FILL, true);
-
- assertOneGravity(Gravity.CLIP_HORIZONTAL, Gravity.CLIP_HORIZONTAL, false);
- assertOneGravity(Gravity.CLIP_HORIZONTAL, Gravity.CLIP_HORIZONTAL, true);
-
- assertOneGravity(Gravity.CLIP_VERTICAL, Gravity.CLIP_VERTICAL, false);
- assertOneGravity(Gravity.CLIP_VERTICAL, Gravity.CLIP_VERTICAL, true);
-
- assertOneGravity(Gravity.LEFT, Gravity.START, false);
- assertOneGravity(Gravity.RIGHT, Gravity.START, true);
-
- assertOneGravity(Gravity.RIGHT, Gravity.END, false);
- assertOneGravity(Gravity.LEFT, Gravity.END, true);
- }
-
- private void assertOneGravity(int expected, int initial, boolean isRtl) {
- final int layoutDirection = isRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR;
-
- assertEquals(expected, Gravity.getAbsoluteGravity(initial, layoutDirection));
- }
-}