Unverified Commit 0fa95b75 authored by Ivan Matkov's avatar Ivan Matkov Committed by GitHub

Remove deprecated OS/Arch values (#1165)

parent 5a908332
...@@ -7,9 +7,6 @@ enum class OS(val id: String) { ...@@ -7,9 +7,6 @@ enum class OS(val id: String) {
MacOS("macos"), MacOS("macos"),
Ios("ios"), Ios("ios"),
Tvos("tvos"), Tvos("tvos"),
@Deprecated("JS is invalid host OS name. Consider using enum KotlinBackend to detect JS.")
JS("js"),
Unknown("unknown") Unknown("unknown")
; ;
...@@ -26,10 +23,6 @@ enum class OS(val id: String) { ...@@ -26,10 +23,6 @@ enum class OS(val id: String) {
enum class Arch(val id: String) { enum class Arch(val id: String) {
X64("x64"), X64("x64"),
Arm64("arm64"), Arm64("arm64"),
@Deprecated("JS is not valid Arch value")
JS("js"),
@Deprecated("WASM is not valid Arch value")
WASM("wasm"),
Unknown("unknown"), Unknown("unknown"),
; ;
} }
......
package org.jetbrains.skiko.tests.org.jetbrains.skiko package org.jetbrains.skiko
import org.jetbrains.skiko.OS
import org.jetbrains.skiko.detectHostOs
import org.jetbrains.skiko.hostOs
import kotlin.test.Test import kotlin.test.Test
import kotlin.test.assertEquals import kotlin.test.assertEquals
import kotlin.test.assertNotEquals
class HostOsTest { class HostOsTest {
@Test
fun canGetHostOs() {
assertNotEquals(OS.JS, hostOs)
}
@Test @Test
fun canGetLinux() { fun canGetLinux() {
spoofUserAgentData("linux") spoofUserAgentData("linux")
...@@ -51,6 +42,13 @@ class HostOsTest { ...@@ -51,6 +42,13 @@ class HostOsTest {
} }
} }
private fun spoofUserAgentData(newValue: String) = private fun spoofUserAgentData(newValue: String) {
js("""navigator.__defineGetter__('userAgentData', function () { return { platform:newValue }; });""") val userAgentData = js("({})")
userAgentData.platform = newValue
js(
"""Object.defineProperty(navigator, 'userAgentData', {
configurable: true,
value: userAgentData
});"""
)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment