am e6ca35d4: Fix ResourceQualifier tests.

Merge commit 'e6ca35d4b0adf8bff8ea8fbc68eb9da16e7f4689' into eclair-plus-aosp

* commit 'e6ca35d4b0adf8bff8ea8fbc68eb9da16e7f4689':
  Fix ResourceQualifier tests.
This commit is contained in:
Xavier Ducrohet
2009-09-28 12:33:55 -07:00
committed by Android Git Automerger
2 changed files with 31 additions and 12 deletions

View File

@@ -18,6 +18,7 @@ package com.android.ide.eclipse.adt.internal.editors.resources.configurations;
import com.android.ide.eclipse.adt.internal.resources.configurations.FolderConfiguration;
import com.android.ide.eclipse.adt.internal.resources.configurations.PixelDensityQualifier;
import com.android.ide.eclipse.adt.internal.resources.configurations.PixelDensityQualifier.Density;
import junit.framework.TestCase;
@@ -41,16 +42,16 @@ public class PixelDensityQualifierTest extends TestCase {
}
public void testCheckAndSet() {
assertEquals(true, pdq.checkAndSet("123dpi", config));//$NON-NLS-1$
assertEquals(true, pdq.checkAndSet("ldpi", config));//$NON-NLS-1$
assertTrue(config.getPixelDensityQualifier() != null);
assertEquals(123, config.getPixelDensityQualifier().getValue());
assertEquals("123dpi", config.getPixelDensityQualifier().toString()); //$NON-NLS-1$
assertEquals(Density.LOW, config.getPixelDensityQualifier().getValue());
assertEquals("ldpi", config.getPixelDensityQualifier().toString()); //$NON-NLS-1$
}
public void testFailures() {
assertEquals(false, pdq.checkAndSet("", config));//$NON-NLS-1$
assertEquals(false, pdq.checkAndSet("dpi", config));//$NON-NLS-1$
assertEquals(false, pdq.checkAndSet("123DPI", config));//$NON-NLS-1$
assertEquals(false, pdq.checkAndSet("123dpi", config));//$NON-NLS-1$
assertEquals(false, pdq.checkAndSet("123", config));//$NON-NLS-1$
assertEquals(false, pdq.checkAndSet("sdfdpi", config));//$NON-NLS-1$
}

View File

@@ -88,13 +88,16 @@ public class ConfigMatchTest extends TestCase {
null, // network code
null, // language
null, // region
null, // screen size
null, // screen ratio
null, // screen orientation
null, // dpi
null, // touch mode
null, // keyboard state
null, // text input
null, // navigation
null); // screen size
null, // screen dimension
null);// version
addFolder(mResources, defaultConfig, validMemberList);
@@ -103,13 +106,16 @@ public class ConfigMatchTest extends TestCase {
null, // network code
"en", // language
null, // region
null, // screen size
null, // screen ratio
null, // screen orientation
null, // dpi
null, // touch mode
KeyboardState.EXPOSED.getValue(), // keyboard state
null, // text input
null, // navigation
null); // screen size
null, // screen dimension
null);// version
addFolder(mResources, config1, validMemberList);
@@ -118,13 +124,16 @@ public class ConfigMatchTest extends TestCase {
null, // network code
"en", // language
null, // region
null, // screen size
null, // screen ratio
null, // screen orientation
null, // dpi
null, // touch mode
KeyboardState.HIDDEN.getValue(), // keyboard state
null, // text input
null, // navigation
null); // screen size
null, // screen dimension
null);// version
addFolder(mResources, config2, validMemberList);
@@ -133,13 +142,16 @@ public class ConfigMatchTest extends TestCase {
null, // network code
"en", // language
null, // region
null, // screen size
null, // screen ratio
ScreenOrientation.LANDSCAPE.getValue(), // screen orientation
null, // dpi
null, // touch mode
null, // keyboard state
null, // text input
null, // navigation
null); // screen size
null, // screen dimension
null);// version
addFolder(mResources, config3, validMemberList);
@@ -148,13 +160,16 @@ public class ConfigMatchTest extends TestCase {
"mnc435", // network code
"en", // language
"rUS", // region
"normal", // screen size
"notlong", // screen ratio
ScreenOrientation.LANDSCAPE.getValue(), // screen orientation
"160dpi", // dpi
"mdpi", // dpi
TouchScreenType.FINGER.getValue(), // touch mode
KeyboardState.EXPOSED.getValue(), // keyboard state
TextInputMethod.QWERTY.getValue(), // text input
NavigationMethod.DPAD.getValue(), // navigation
"480x320"); // screen size
"480x320", // screen dimension
"v3"); // version
addFolder(mResources, config4, invalidMemberList);
}
@@ -171,13 +186,16 @@ public class ConfigMatchTest extends TestCase {
"mnc435", // network code
"en", // language
"rUS", // region
"normal", // screen size
"notlong", // screen ratio
ScreenOrientation.LANDSCAPE.getValue(), // screen orientation
"160dpi", // dpi
"mdpi", // dpi
TouchScreenType.FINGER.getValue(), // touch mode
KeyboardState.EXPOSED.getValue(), // keyboard state
TextInputMethod.QWERTY.getValue(), // text input
NavigationMethod.DPAD.getValue(), // navigation
"480x320"); // screen size
"480x320", // screen dimension
"v3"); // version
ResourceFile result = mResources.getMatchingFile(SEARCHED_FILENAME,
ResourceFolderType.LAYOUT, testConfig);