-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This CL aligns the UA-CH implementation with PR#46[1], #48[2] and #70[3]. [1] WICG/ua-client-hints#46 [2] WICG/ua-client-hints#48 [3] WICG/ua-client-hints#70 Change-Id: I8221d8a967213180a1aa1d9ef23f17e6f95718b7
- Loading branch information
1 parent
b32ae7b
commit b14db07
Showing
3 changed files
with
28 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...ppapis/system-state-and-capabilities/the-navigator-object/navigator_user_agent.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/webrtc/dictionary-helper.js"></script> | ||
<script> | ||
test(t => { | ||
assert_true("getUserAgent" in navigator); | ||
}, "navigator.getUserAgent() is exposed."); | ||
|
||
promise_test(t => { | ||
return new Promise(async (resolve) => { | ||
const ua = navigator.getUserAgent(); | ||
for (brand of ua.brand) { | ||
assert_equals(typeof brand.brand, 'string', "brand should be a string"); | ||
assert_equals(typeof brand.version, 'string', "version should be a string"); | ||
} | ||
const platform = await ua.getPlatform(); | ||
assert_equals(typeof platform.brand, 'string', "Platform brand should be a string"); | ||
assert_equals(typeof platform.version, 'string', "Platform version should be a string"); | ||
const architecture = await ua.getArchitecture(); | ||
assert_equals(typeof architecture, 'string', "Architecture should be a string"); | ||
const model = await ua.getModel(); | ||
assert_equals(typeof model, 'string', "Model should be a string"); | ||
resolve(); | ||
}); | ||
}, "navigator.getUserAgent() returns a UserAgentMetadata object."); | ||
</script> |
21 changes: 0 additions & 21 deletions
21
...tem-state-and-capabilities/the-navigator-object/navigator_user_agent.tentative.https.html
This file was deleted.
Oops, something went wrong.