Add Origin Trial layout tests for IDL bindings
The existing layout tests for Origin Trials cover both various enabling
scenarios, as well as bindings for [OriginTrialEnabled].
As shown by bug 695123, there isn't comprehensive coverage for all the
bindings possibilities.
This CL adds a separate set of layout tests explicitly for bindings,
in preparation for fixing bug 695123.
BUG=695123
Review-Url: https://codereview.chromium.org/2861673007
Cr-Commit-Position: refs/heads/master@{#469862}
Committed: https://chromium.googlesource.com/chromium/src/+/fbd04b8d08a73374d9720de6c01ff36dd13428a1
Dry run: Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/261734) win_chromium_rel_ng on ...
3 years, 7 months ago
(2017-05-04 17:41:32 UTC)
#4
Description was changed from ========== Add Origin Trial layout tests for IDL bindings The existing ...
3 years, 7 months ago
(2017-05-04 20:03:56 UTC)
#5
Description was changed from
==========
Add Origin Trial layout tests for IDL bindings
The existing layout tests for Origin Trials cover both various enabling
scenarios, as well as bindings for [OriginTrialEnabled].
As shown by bug 695123, there isn't comprehensive coverage for all the
bindings possibilities.
This CL adds a separate set of layout tests explicitly for bindings.
BUG=695123
==========
to
==========
Add Origin Trial layout tests for IDL bindings
The existing layout tests for Origin Trials cover both various enabling
scenarios, as well as bindings for [OriginTrialEnabled].
As shown by bug 695123, there isn't comprehensive coverage for all the
bindings possibilities.
This CL adds a separate set of layout tests explicitly for bindings,
in preparation for fixing bug 695123.
BUG=695123
==========
3 years, 7 months ago
(2017-05-04 20:04:28 UTC)
#7
iclelland, please take a look.
iclelland
This looks great, very comprehensive. Just a couple of nits around making sure the tests ...
3 years, 7 months ago
(2017-05-05 14:11:34 UTC)
#8
This looks great, very comprehensive. Just a couple of nits around making sure
the tests are clear, in case someone else wants to extend this someday.
Have you checked the generated files to see what's up with the windows compile
error?
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
File
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js
(right):
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js:6:
expect_member = (name, get_value_func) => {
I like the use of the lambdas here -- can you document what this method is
expected to test? Reading through the code that calls it, it wasn't apparent
immediately that 'name' wasn't just a docstring, but is *also* used to test
whether the member is visible.
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js:10:
'Member should return boolean value');
The member is required to return 'true', and not just any boolean, right? We
should either change the message to "Member should return true", or have this
method taken an expected value like expect_constant does, and then we can use
assert_equals instead.
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js:26:
'Constant should return integer value');
Maybe change "integer" to "expected"; unless there's good reason to expect an
int in every case. (Or else maybe rename to "expect_numeric_constant", and
actually check that its type is Number -- ints aren't really special in JS)
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js:461:
expect_failure_bindings = (description_suffix) => {
Nit: This should probably have a comment, for parity with all of the other
methods around it.
chasej
iclelland, please take another look. https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js File third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js (right): https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js#newcode6 third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js:6: expect_member = (name, get_value_func) ...
3 years, 7 months ago
(2017-05-05 15:29:29 UTC)
#9
iclelland, please take another look.
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
File
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js
(right):
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js:6:
expect_member = (name, get_value_func) => {
On 2017/05/05 14:11:34, iclelland wrote:
> I like the use of the lambdas here -- can you document what this method is
> expected to test? Reading through the code that calls it, it wasn't apparent
> immediately that 'name' wasn't just a docstring, but is *also* used to test
> whether the member is visible.
I documented what each expect function does. I also renamed to "member_name", so
hopefully that minimizes confusion.
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js:10:
'Member should return boolean value');
On 2017/05/05 14:11:34, iclelland wrote:
> The member is required to return 'true', and not just any boolean, right? We
> should either change the message to "Member should return true", or have this
> method taken an expected value like expect_constant does, and then we can use
> assert_equals instead.
I prefer to leave as is.
The specific return value/type isn't really important. It's really testing that
the member exists and returns a real value (i.e. not undefined). For simplicity,
all the attributes/methods are defined as boolean. Obviously, "true" is better,
since undefined won't convert to true. I think adding an expected value is just
extra code for minimal value. For expect_constant, I think the expected value is
useful to distinguish different constants.
As for the message, a failed assertion will clearly state that true was
expected, but got false instead.
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js:26:
'Constant should return integer value');
On 2017/05/05 14:11:34, iclelland wrote:
> Maybe change "integer" to "expected"; unless there's good reason to expect an
> int in every case. (Or else maybe rename to "expect_numeric_constant", and
> actually check that its type is Number -- ints aren't really special in JS)
Done. Changed to "expected". The type isn't really important to testing the
constant.
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js:461:
expect_failure_bindings = (description_suffix) => {
On 2017/05/05 14:11:34, iclelland wrote:
> Nit: This should probably have a comment, for parity with all of the other
> methods around it.
Done.
iclelland
Thanks, this lgtm -- once the compile failures are fixed, obviously :) https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js File third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js ...
3 years, 7 months ago
(2017-05-05 15:37:27 UTC)
#10
Thanks, this lgtm -- once the compile failures are fixed, obviously :)
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
File
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js
(right):
https://codereview.chromium.org/2861673007/diff/1/third_party/WebKit/LayoutTe...
third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js:10:
'Member should return boolean value');
On 2017/05/05 15:29:29, chasej wrote:
> On 2017/05/05 14:11:34, iclelland wrote:
> > The member is required to return 'true', and not just any boolean, right? We
> > should either change the message to "Member should return true", or have
this
> > method taken an expected value like expect_constant does, and then we can
use
> > assert_equals instead.
>
> I prefer to leave as is.
>
> The specific return value/type isn't really important. It's really testing
that
> the member exists and returns a real value (i.e. not undefined). For
simplicity,
> all the attributes/methods are defined as boolean. Obviously, "true" is
better,
> since undefined won't convert to true. I think adding an expected value is
just
> extra code for minimal value. For expect_constant, I think the expected value
is
> useful to distinguish different constants.
>
> As for the message, a failed assertion will clearly state that true was
> expected, but got false instead.
Acknowledged. That makes sense.
chasej
The CQ bit was checked by chasej@chromium.org to run a CQ dry run
3 years, 7 months ago
(2017-05-05 21:16:59 UTC)
#11
CQ is committing da patch. Bot data: {"patchset_id": 40001, "attempt_start_ts": 1494032641964950, "parent_rev": "05fa41d9751a443a76dde0fe53cbfa927bb5d001", "commit_rev": "fbd04b8d08a73374d9720de6c01ff36dd13428a1"}
3 years, 7 months ago
(2017-05-06 19:03:57 UTC)
#21
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1494032641964950,
"parent_rev": "05fa41d9751a443a76dde0fe53cbfa927bb5d001", "commit_rev":
"fbd04b8d08a73374d9720de6c01ff36dd13428a1"}
commit-bot: I haz the power
Description was changed from ========== Add Origin Trial layout tests for IDL bindings The existing ...
3 years, 7 months ago
(2017-05-06 19:04:10 UTC)
#22
Message was sent while issue was closed.
Description was changed from
==========
Add Origin Trial layout tests for IDL bindings
The existing layout tests for Origin Trials cover both various enabling
scenarios, as well as bindings for [OriginTrialEnabled].
As shown by bug 695123, there isn't comprehensive coverage for all the
bindings possibilities.
This CL adds a separate set of layout tests explicitly for bindings,
in preparation for fixing bug 695123.
BUG=695123
==========
to
==========
Add Origin Trial layout tests for IDL bindings
The existing layout tests for Origin Trials cover both various enabling
scenarios, as well as bindings for [OriginTrialEnabled].
As shown by bug 695123, there isn't comprehensive coverage for all the
bindings possibilities.
This CL adds a separate set of layout tests explicitly for bindings,
in preparation for fixing bug 695123.
BUG=695123
Review-Url: https://codereview.chromium.org/2861673007
Cr-Commit-Position: refs/heads/master@{#469862}
Committed:
https://chromium.googlesource.com/chromium/src/+/fbd04b8d08a73374d9720de6c01f...
==========
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/fbd04b8d08a73374d9720de6c01ff36dd13428a1
3 years, 7 months ago
(2017-05-06 19:04:11 UTC)
#23
Issue 2861673007: Add Origin Trial layout tests for IDL bindings
(Closed)
Created 3 years, 7 months ago by chasej
Modified 3 years, 7 months ago
Reviewers: jbroman, iclelland
Base URL:
Comments: 9