Skip to content

Commit

Permalink
Android is a variant of Linux, but this breaks the matching process.
Browse files Browse the repository at this point in the history
In the matching process, any request with Linux as a platform will also
match a node with Android as a platform. This does not make sense since
a test for Chrome/Linux could end up running in an Appium-Android node.

For the same reasons iOS had already family set to null, therefore now
setting family to null for Android.
  • Loading branch information
diemol committed Jan 12, 2019
1 parent 914059b commit 0f726f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion java/client/src/org/openqa/selenium/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public Platform family() {
ANDROID("android", "dalvik") {
@Override
public Platform family() {
return LINUX;
return null;
}
},

Expand Down
16 changes: 11 additions & 5 deletions java/client/test/org/openqa/selenium/PlatformTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.openqa.selenium.Platform.ANDROID;
import static org.openqa.selenium.Platform.ANY;
import static org.openqa.selenium.Platform.IOS;
import static org.openqa.selenium.Platform.LINUX;
import static org.openqa.selenium.Platform.MAC;
import static org.openqa.selenium.Platform.UNIX;
Expand Down Expand Up @@ -63,11 +64,6 @@ public void testUnixIsNotLinux() {
assertThat(UNIX.is(LINUX)).isFalse();
}

@Test
public void androidIsAUnixVariant() {
assertThat(ANDROID.is(UNIX)).isTrue();
}

@Test
public void testXpIsAny() {
assertThat(XP.is(ANY)).isTrue();
Expand Down Expand Up @@ -139,6 +135,16 @@ public void unixIsUnix() {
assertThat(UNIX.is(UNIX)).isTrue();
}

@Test
public void androidIAndroid() {
assertThat(ANDROID.is(ANDROID)).isTrue();
}

@Test
public void iosIsIos() {
assertThat(IOS.is(IOS)).isTrue();
}

@Test
public void testWindows8Detection() {
assertThat(Platform.extractFromSysProperty("windows nt (unknown)", "6.2")).isEqualTo(Platform.WIN8);
Expand Down

0 comments on commit 0f726f0

Please sign in to comment.