Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement navigator.platform #7582

Merged
merged 1 commit into from Sep 29, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -22,8 +22,19 @@ pub fn AppCodeName() -> DOMString {
"Mozilla".to_owned()
}

#[cfg(target_os = "windows")]
pub fn Platform() -> DOMString {
"".to_owned()
"Win32".to_owned()
}

#[cfg(any(target_os = "android", target_os = "linux"))]
pub fn Platform() -> DOMString {
"Linux".to_owned()
}

#[cfg(target_os = "macos")]
pub fn Platform() -> DOMString {
"Mac".to_owned()
}

pub fn UserAgent() -> DOMString {
@@ -0,0 +1,12 @@
[navigator.html]
type: testharness

[navigator.platform linux]
expected:
if os != "linux": FAIL
PASS

[navigator.platform mac]
expected:
if os != "mac": FAIL
PASS
@@ -15,9 +15,19 @@
assert_equals(nav.taintEnabled(), false);
assert_equals(nav.appName, "Netscape");
assert_equals(nav.appCodeName, "Mozilla");
assert_equals(nav.platform, "");
assert_equals(nav.appVersion, "4.0");
});
}, "navigator");


test(function() {
assert_equals(navigator.platform, "Linux");
}, "navigator.platform linux");

test(function() {
assert_equals(navigator.platform, "Mac");
}, "navigator.platform mac");


</script>
</body>
</html>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.