-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Expose the optional UserUnit entry as a page property #7832
Expose the optional UserUnit entry as a page property #7832
Conversation
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/02086fde5bbfbc4/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/02086fde5bbfbc4/output.txt Total script time: 2.74 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/4aedfd7b93108f0/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/11bc75d40ec9939/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/4aedfd7b93108f0/output.txt Total script time: 26.04 mins
Image differences available at: http://107.22.172.223:8877/4aedfd7b93108f0/reftest-analyzer.html#web=eq.log |
@@ -138,6 +138,15 @@ var Page = (function PageClosure() { | |||
return shadow(this, 'mediaBox', obj); | |||
}, | |||
|
|||
get userUnit() { | |||
var obj = this.getPageProp('UserUnit'); | |||
// Optional according to the spec with a default value of 1.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the comment and introduce DEFAULT_USER_UNIT = 1.0;
constant above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed.
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/11bc75d40ec9939/output.txt Total script time: 41.25 mins
Image differences available at: http://107.21.233.14:8877/11bc75d40ec9939/reftest-analyzer.html#web=eq.log |
31fe234
to
cc618e6
Compare
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/357d50c8ff77e13/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/357d50c8ff77e13/output.txt Total script time: 2.17 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/ffbd93659b11303/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/0e26674a8fe4a92/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/ffbd93659b11303/output.txt Total script time: 25.71 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/0e26674a8fe4a92/output.txt Total script time: 26.90 mins
|
@@ -138,6 +139,14 @@ var Page = (function PageClosure() { | |||
return shadow(this, 'mediaBox', obj); | |||
}, | |||
|
|||
get userUnit() { | |||
var obj = this.getPageProp('UserUnit'); | |||
if (typeof obj !== 'number') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the isNum
utility function instead; note that you may have to add var isNum = sharedUtil.isNum;
at top of the file along with the other sharedUtil
imports.
Furthermore, since the specification mentions that this should be a positive number, let's add a check for that as well, e.g.
if (!(isNum(obj) && obj > 0)) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed.
cc618e6
to
f76cd2c
Compare
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/cf10118c7e368cf/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/9b0d3541007b7fb/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/cf10118c7e368cf/output.txt Total script time: 26.15 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/9b0d3541007b7fb/output.txt Total script time: 26.41 mins
|
Thank you! |
…page Expose the optional UserUnit entry as a page property
This provides access to the optional
UserUnit
page entry from spec v1.6+ for consumers of the API. Returns a default value of 1.0 (per spec) when entry is not present.I've attempted to follow the pattern used by other page entries, as found in the surrounding code.