aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2010-12-09 14:49:13 -0800
committerTor Norbye <tnorbye@google.com>2010-12-09 14:49:13 -0800
commitfe3eebe57ba2925642cc1b257cb03ba617d298af (patch)
tree8a348ddd82b7b13754115a3a715fcc6e3990a8d4 /eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java
parentf7bb5e5fe9c3e6cda5f6d2c4a1db4673a2f8f02d (diff)
downloadsdk-fe3eebe57ba2925642cc1b257cb03ba617d298af.zip
sdk-fe3eebe57ba2925642cc1b257cb03ba617d298af.tar.gz
sdk-fe3eebe57ba2925642cc1b257cb03ba617d298af.tar.bz2
Issue 13051: Use match_parent or fill_parent based on API level
Fixes issue 13051: New layout editor always insert "match_parent", even on older platform. View rules can now look up the API level of the current project, and based on that choose to use match_parent or fill_parent when they need to manipulate the layout attributes. Change-Id: I861e1f7f7409c40c05b1472268f120806667025c
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java
index 520f984..4f29932 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java
@@ -28,9 +28,9 @@ import com.android.ide.common.api.IMenuCallback;
import com.android.ide.common.api.INode;
import com.android.ide.common.api.IViewRule;
import com.android.ide.common.api.MenuAction;
-import com.android.ide.common.api.MenuAction.Choices;
import com.android.ide.common.api.Point;
import com.android.ide.common.api.Rect;
+import com.android.ide.common.api.MenuAction.Choices;
import java.util.List;
@@ -41,6 +41,7 @@ public class LinearLayoutRuleTest extends LayoutTestBase {
boolean haveBounds = dragBounds.isValid();
IViewRule rule = new LinearLayoutRule();
+
INode targetNode = TestNode.create("android.widget.LinearLayout").id(
"@+id/LinearLayout01").bounds(new Rect(0, 0, 240, 480));
Point dropPoint = new Point(10, 5);
@@ -118,6 +119,7 @@ public class LinearLayoutRuleTest extends LayoutTestBase {
// Check that the context menu registers the expected menu items
public void testContextMenu() {
LinearLayoutRule rule = new LinearLayoutRule();
+ initialize(rule, "android.widget.LinearLayout");
INode node = TestNode.create("android.widget.Button").id("@+id/Button012");
List<MenuAction> contextMenu = rule.getContextMenu(node);
@@ -135,6 +137,7 @@ public class LinearLayoutRuleTest extends LayoutTestBase {
// Check that the context menu manipulates the orientation attribute
public void testOrientation() {
LinearLayoutRule rule = new LinearLayoutRule();
+ initialize(rule, "android.widget.LinearLayout");
INode node = TestNode.create("android.widget.Button").id("@+id/Button012");
assertNull(node.getStringAttr(ANDROID_URI, ATTR_ORIENTATION));