|
|
Chromium Code Reviews
DescriptionUpdate tests for snapshot allowfullscreen behavior
As part of moving the Fullscreen API to Feature Policy, the behaviour of
the iframe "allowfullscreen" attribute is changing slightly -- it is now
being sampled once, when the frame content loads, and that value is used
when the frame tries to go fullscreen, regardless of whether it has been
changed. This CL updates the tests which were depending on that behavior
and introduces a new way of calling the cross-site-iframe-factory script
to attach additional attributes to iframes at creation time.
BUG=718155
Review-Url: https://codereview.chromium.org/2855973005
Cr-Commit-Position: refs/heads/master@{#469839}
Committed: https://chromium.googlesource.com/chromium/src/+/c3c6e3d369c0d2246d3e63eec0cddd12b7eaee2a
Patch Set 1 #Patch Set 2 : Fix iframe factory site canonicalization #
Total comments: 9
Patch Set 3 : Move parsing of attribute lists to tree_parser_util.js #
Total comments: 6
Patch Set 4 : Update docs #
Messages
Total messages: 33 (21 generated)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
iclelland@chromium.org changed reviewers: + alexmos@chromium.org
+r alexmos, you appear to be the specific OWNER for this file, can you take a look? +cc foolip FYI because this is a change to Fullscreen tests
LGTM for the test change, and +nick@ to double-check cross_site_iframe_factory.html: Nick originally wrote it and might have thoughts. The factory change looks reasonable to me and something I've always wanted, so thanks for doing it! https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... File content/test/data/cross_site_iframe_factory.html (right): https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... content/test/data/cross_site_iframe_factory.html:23: cross_site_iframe_factory.html?a(b{allowfullscreen}(),c{sandbox-allow-scripts}(d)) Awesome, this can also simplify some of our other tests, such as the ones for sandbox flags. Any value in doing args with values as c{sandbox=allow-scripts}, which might be a bit easier to read? Though I guess we can't avoid repeating "sandbox" when you need to specify multiple sandbox values? https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... content/test/data/cross_site_iframe_factory.html:149: nit: no blank line, or move it one line down?
alexmos@chromium.org changed reviewers: + nick@chromium.org
Actually adding nick@
I love this https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... File content/test/data/cross_site_iframe_factory.html (right): https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... content/test/data/cross_site_iframe_factory.html:23: cross_site_iframe_factory.html?a(b{allowfullscreen}(),c{sandbox-allow-scripts}(d)) On 2017/05/04 21:47:00, alexmos wrote: > Awesome, this can also simplify some of our other tests, such as the ones for > sandbox flags. Any value in doing args with values as c{sandbox=allow-scripts}, > which might be a bit easier to read? Though I guess we can't avoid repeating > "sandbox" when you need to specify multiple sandbox values? I'm okay with either of these options. https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... content/test/data/cross_site_iframe_factory.html:105: function splitSiteAndArgs(siteAndArgsString) { Would it make more sense to do the parsing of the argument syntax as part of TreeParserUtil? (applyIframeFeatures belongs here, but lexing the argument list -- the {;} tokens -- seems like maybe it would be better done in the parser?) https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... content/test/data/cross_site_iframe_factory.html:143: if (option.startsWith("sandbox-")) { I think this means that a(b{sandbox-}) will work like <iframe sandbox> with no sandbox arguments?
https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... File content/test/data/cross_site_iframe_factory.html (right): https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... content/test/data/cross_site_iframe_factory.html:23: cross_site_iframe_factory.html?a(b{allowfullscreen}(),c{sandbox-allow-scripts}(d)) On 2017/05/04 21:47:00, alexmos wrote: > Awesome, this can also simplify some of our other tests, such as the ones for > sandbox flags. Any value in doing args with values as c{sandbox=allow-scripts}, > which might be a bit easier to read? Though I guess we can't avoid repeating > "sandbox" when you need to specify multiple sandbox values? Right, we would still need to write it as {sandbox=allow-scripts;sandbox=allow-popups}. I was trying to stay away from anything that would make the query string look like a set of key-value pairs. https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... content/test/data/cross_site_iframe_factory.html:105: function splitSiteAndArgs(siteAndArgsString) { On 2017/05/04 22:06:56, ncarter wrote: > Would it make more sense to do the parsing of the argument syntax as part of > TreeParserUtil? (applyIframeFeatures belongs here, but lexing the argument list > -- the {;} tokens -- seems like maybe it would be better done in the parser?) Maybe -- I wasn't sure how generic TreeParserUtil needed to be, but I can easily move this method into there, and it can be called (or not) by the scripts that use it. https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... content/test/data/cross_site_iframe_factory.html:143: if (option.startsWith("sandbox-")) { On 2017/05/04 22:06:56, ncarter wrote: > I think this means that a(b{sandbox-}) will work like <iframe sandbox> with no > sandbox arguments? It should work like that -- It's a good hack :) I had considered also adding a(b{sandbox}) as valid syntax, to create <iframe sandbox> with no args, but didn't know if there was a use for it.
The CQ bit was checked by iclelland@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/05/05 14:54:28, iclelland wrote: > https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... > File content/test/data/cross_site_iframe_factory.html (right): > > https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... > content/test/data/cross_site_iframe_factory.html:23: > cross_site_iframe_factory.html?a(b{allowfullscreen}(),c{sandbox-allow-scripts}(d)) > On 2017/05/04 21:47:00, alexmos wrote: > > Awesome, this can also simplify some of our other tests, such as the ones for > > sandbox flags. Any value in doing args with values as > c{sandbox=allow-scripts}, > > which might be a bit easier to read? Though I guess we can't avoid repeating > > "sandbox" when you need to specify multiple sandbox values? > > Right, we would still need to write it as > {sandbox=allow-scripts;sandbox=allow-popups}. I was trying to stay away from > anything that would make the query string look like a set of key-value pairs. > > https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... > content/test/data/cross_site_iframe_factory.html:105: function > splitSiteAndArgs(siteAndArgsString) { > On 2017/05/04 22:06:56, ncarter wrote: > > Would it make more sense to do the parsing of the argument syntax as part of > > TreeParserUtil? (applyIframeFeatures belongs here, but lexing the argument > list > > -- the {;} tokens -- seems like maybe it would be better done in the parser?) > > Maybe -- I wasn't sure how generic TreeParserUtil needed to be, but I can easily > move this method into there, and it can be called (or not) by the scripts that > use it. > > https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... > content/test/data/cross_site_iframe_factory.html:143: if > (option.startsWith("sandbox-")) { > On 2017/05/04 22:06:56, ncarter wrote: > > I think this means that a(b{sandbox-}) will work like <iframe sandbox> with no > > sandbox arguments? > > It should work like that -- It's a good hack :) I had considered also adding > a(b{sandbox}) as valid syntax, to create <iframe sandbox> with no args, but > didn't know if there was a use for it. ncarter@ -- can you take another look? I moved parsing into tree_parser_util.js, and so restructured it a bit. It let me use ',' as the attribute separator, which I like better (I fixed a bug in the token matcher as well -- it turns out to be the reason that the reason I could get ';','{','}' in the hostname at all)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm https://codereview.chromium.org/2855973005/diff/40001/content/test/data/tree_... File content/test/data/tree_parser_util.js (right): https://codereview.chromium.org/2855973005/diff/40001/content/test/data/tree_... content/test/data/tree_parser_util.js:46: * TreeParserUtil.parse('b{red,blue}(c,d{green})'; So it turns out that I did write unittests for this, but couldn't figure out how to hook them up to actually run. :( If you want to play with them, there's a file in ps4 of the original code review here: https://codereview.chromium.org/1264923002/#ps50001 https://codereview.chromium.org/2855973005/diff/40001/content/test/data/tree_... content/test/data/tree_parser_util.js:105: attributes: takeAttributeList(tokenStream), The jsdoc suggests that attributes here will be omitted if the result of takeAttributeList() is empty. An empty attribute list is more caller-friendly, but omitting the attributes property is definitely more documentation-friendly. I guess we should just go ahead and update the jsdoc? https://codereview.chromium.org/2855973005/diff/40001/content/test/data/tree_... content/test/data/tree_parser_util.js:147: // Additional entries allowed with comman. comman -> comma
https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... File content/test/data/cross_site_iframe_factory.html (right): https://codereview.chromium.org/2855973005/diff/20001/content/test/data/cross... content/test/data/cross_site_iframe_factory.html:143: if (option.startsWith("sandbox-")) { On 2017/05/05 14:54:28, iclelland wrote: > On 2017/05/04 22:06:56, ncarter wrote: > > I think this means that a(b{sandbox-}) will work like <iframe sandbox> with no > > sandbox arguments? > > It should work like that -- It's a good hack :) I had considered also adding > a(b{sandbox}) as valid syntax, to create <iframe sandbox> with no args, but > didn't know if there was a use for it. I think in practice folks are likely going to want to allow scripts for testing.
The CQ bit was checked by iclelland@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from alexmos@chromium.org Link to the patchset: https://codereview.chromium.org/2855973005/#ps40001 (title: "Move parsing of attribute lists to tree_parser_util.js")
The CQ bit was unchecked by iclelland@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2855973005/diff/40001/content/test/data/tree_... File content/test/data/tree_parser_util.js (right): https://codereview.chromium.org/2855973005/diff/40001/content/test/data/tree_... content/test/data/tree_parser_util.js:46: * TreeParserUtil.parse('b{red,blue}(c,d{green})'; On 2017/05/05 22:34:05, ncarter wrote: > So it turns out that I did write unittests for this, but couldn't figure out how > to hook them up to actually run. :( > > If you want to play with them, there's a file in ps4 of the original code review > here: > > https://codereview.chromium.org/1264923002/#ps50001 Thanks! I will definitely take a look. https://codereview.chromium.org/2855973005/diff/40001/content/test/data/tree_... content/test/data/tree_parser_util.js:105: attributes: takeAttributeList(tokenStream), On 2017/05/05 22:34:05, ncarter wrote: > The jsdoc suggests that attributes here will be omitted if the result of > takeAttributeList() is empty. > > An empty attribute list is more caller-friendly, but omitting the attributes > property is definitely more documentation-friendly. > > I guess we should just go ahead and update the jsdoc? Updated. https://codereview.chromium.org/2855973005/diff/40001/content/test/data/tree_... content/test/data/tree_parser_util.js:147: // Additional entries allowed with comman. On 2017/05/05 22:34:05, ncarter wrote: > comman -> comma Thanks, done
The CQ bit was checked by iclelland@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from nick@chromium.org, alexmos@chromium.org Link to the patchset: https://codereview.chromium.org/2855973005/#ps60001 (title: "Update docs")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 60001, "attempt_start_ts": 1494039796655740,
"parent_rev": "9423dea0bc0392b47696282d40770ab21c9177f9", "commit_rev":
"c3c6e3d369c0d2246d3e63eec0cddd12b7eaee2a"}
Message was sent while issue was closed.
Description was changed from ========== Update tests for snapshot allowfullscreen behavior As part of moving the Fullscreen API to Feature Policy, the behaviour of the iframe "allowfullscreen" attribute is changing slightly -- it is now being sampled once, when the frame content loads, and that value is used when the frame tries to go fullscreen, regardless of whether it has been changed. This CL updates the tests which were depending on that behavior and introduces a new way of calling the cross-site-iframe-factory script to attach additional attributes to iframes at creation time. BUG=718155 ========== to ========== Update tests for snapshot allowfullscreen behavior As part of moving the Fullscreen API to Feature Policy, the behaviour of the iframe "allowfullscreen" attribute is changing slightly -- it is now being sampled once, when the frame content loads, and that value is used when the frame tries to go fullscreen, regardless of whether it has been changed. This CL updates the tests which were depending on that behavior and introduces a new way of calling the cross-site-iframe-factory script to attach additional attributes to iframes at creation time. BUG=718155 Review-Url: https://codereview.chromium.org/2855973005 Cr-Commit-Position: refs/heads/master@{#469839} Committed: https://chromium.googlesource.com/chromium/src/+/c3c6e3d369c0d2246d3e63eec0cd... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/c3c6e3d369c0d2246d3e63eec0cd... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
