Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Issue 2560253004: IntersectionObserver: convert tests to testharness.js (Closed)

Created:
4 years ago by szager1
Modified:
3 years, 11 months ago
Reviewers:
foolip, Rick Byers, ojan
CC:
chromium-reviews, blink-reviews, Rick Byers
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

IntersectionObserver: convert tests to testharness.js No loss of coverage, but a few chromium-specific (hence non-upstreamable to w3c) tests were split out into separate files. The cross-origin-iframe test was moved out of http/tests and now just uses the 'sandbox' iframe attribute instead. R=foolip@chromium.org,ojan@chromium.org BUG= Review-Url: https://codereview.chromium.org/2560253004 Cr-Commit-Position: refs/heads/master@{#445564} Committed: https://chromium.googlesource.com/chromium/src/+/a2933a3bfccbc547107f31eb878c86d9e79ed61d

Patch Set 1 #

Patch Set 2 : rebase #

Total comments: 22

Patch Set 3 : Convert to interleaved async_test's. #

Patch Set 4 : Formatting tweaks and explicit resource paths #

Total comments: 51

Patch Set 5 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1234 lines, -2097 lines) Patch
D third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html View 1 chunk +0 lines, -66 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin-expected.txt View 1 chunk +0 lines, -42 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/intersection-observer/resources/cross-origin-subframe.html View 1 chunk +0 lines, -75 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/client-rect.html View 1 2 3 4 1 chunk +39 lines, -21 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/client-rect-expected.txt View 1 chunk +0 lines, -14 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/containing-block.html View 1 2 3 4 2 chunks +40 lines, -56 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/containing-block-expected.txt View 1 chunk +0 lines, -40 lines 0 comments Download
A third_party/WebKit/LayoutTests/intersection-observer/cross-origin-iframe.html View 1 2 3 4 1 chunk +55 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/intersection-observer/deleted-root.html View 1 2 3 4 1 chunk +49 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/display-none.html View 1 2 3 4 2 chunks +29 lines, -91 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/display-none-expected.txt View 1 chunk +0 lines, -54 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/edge-inclusive-intersection.html View 1 2 3 4 2 chunks +32 lines, -52 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/edge-inclusive-intersection-expected.txt View 1 chunk +0 lines, -40 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/iframe-no-root.html View 1 2 3 4 1 chunk +49 lines, -57 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/iframe-no-root-expected.txt View 1 chunk +0 lines, -41 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/multiple-targets.html View 1 2 3 2 chunks +49 lines, -34 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/multiple-targets-expected.txt View 1 chunk +0 lines, -19 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/multiple-thresholds.html View 1 2 3 4 1 chunk +52 lines, -161 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/multiple-thresholds-expected.txt View 1 chunk +0 lines, -131 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/observer-attributes.html View 1 2 3 4 1 chunk +20 lines, -10 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/observer-attributes-expected.txt View 1 chunk +0 lines, -15 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions.html View 1 2 3 4 1 chunk +44 lines, -83 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions-expected.txt View 1 2 3 4 1 chunk +0 lines, -21 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/observer-in-iframe.html View 1 2 3 1 chunk +8 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/observer-without-js-reference.html View 1 2 3 1 chunk +48 lines, -17 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/observer-without-js-reference-expected.txt View 1 chunk +0 lines, -10 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/remove-element.html View 1 2 3 4 1 chunk +59 lines, -71 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/remove-element-expected.txt View 1 chunk +0 lines, -53 lines 0 comments Download
A + third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html View 1 2 3 4 4 chunks +53 lines, -9 lines 0 comments Download
A + third_party/WebKit/LayoutTests/intersection-observer/resources/iframe-no-root-subframe.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A third_party/WebKit/LayoutTests/intersection-observer/resources/intersection-observer-test-utils.js View 1 2 3 4 1 chunk +112 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/intersection-observer/resources/observer-in-iframe-subframe.html View 1 2 3 4 1 chunk +65 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/intersection-observer/resources/timestamp-subframe.html View 1 2 1 chunk +28 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/root-margin.html View 1 2 3 4 1 chunk +50 lines, -60 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/root-margin-expected.txt View 1 chunk +0 lines, -45 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html View 1 2 3 4 1 chunk +44 lines, -52 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root-expected.txt View 1 chunk +0 lines, -41 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/same-document-root.html View 1 2 3 4 1 chunk +57 lines, -77 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/same-document-root-expected.txt View 1 chunk +0 lines, -55 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/same-document-zero-size-target.html View 1 2 3 4 1 chunk +45 lines, -52 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/same-document-zero-size-target-expected.txt View 1 chunk +0 lines, -41 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/shadow-content.html View 1 2 3 4 1 chunk +32 lines, -32 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/shadow-content-expected.txt View 1 chunk +0 lines, -24 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/timestamp.html View 1 2 3 1 chunk +81 lines, -62 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/timestamp-expected.txt View 1 chunk +0 lines, -17 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/unclipped-root.html View 1 2 3 4 2 chunks +28 lines, -35 lines 0 comments Download
D third_party/WebKit/LayoutTests/intersection-observer/unclipped-root-expected.txt View 1 chunk +0 lines, -25 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/zero-area-element-hidden.html View 1 2 3 1 chunk +34 lines, -15 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/zero-area-element-visible.html View 1 2 3 1 chunk +33 lines, -15 lines 0 comments Download
D third_party/WebKit/LayoutTests/resources/intersection-observer-helper-functions.js View 1 chunk +0 lines, -99 lines 0 comments Download
D third_party/WebKit/LayoutTests/resources/intersection-observer-in-iframe.html View 1 1 chunk +0 lines, -49 lines 0 comments Download
D third_party/WebKit/LayoutTests/resources/intersection-observer-subframe.html View 1 chunk +0 lines, -4 lines 0 comments Download
D third_party/WebKit/LayoutTests/resources/intersection-observer-timestamp-subframe.html View 1 chunk +0 lines, -14 lines 0 comments Download

Messages

Total messages: 33 (17 generated)
szager1
4 years ago (2016-12-10 01:29:11 UTC) #2
szager1
foolip@, can I interest you in a code review? This is in preparation for upstreaming ...
4 years ago (2016-12-13 22:19:08 UTC) #8
foolip
Took a close look at the first test and suggested what will amount to be ...
4 years ago (2016-12-14 13:42:17 UTC) #9
szager1
https://codereview.chromium.org/2560253004/diff/20001/third_party/WebKit/LayoutTests/intersection-observer/client-rect.html File third_party/WebKit/LayoutTests/intersection-observer/client-rect.html (right): https://codereview.chromium.org/2560253004/diff/20001/third_party/WebKit/LayoutTests/intersection-observer/client-rect.html#newcode10 third_party/WebKit/LayoutTests/intersection-observer/client-rect.html:10: setTimeout(f); On 2016/12/14 13:42:16, foolip wrote: > Is the ...
4 years ago (2016-12-14 19:54:11 UTC) #10
szager1
https://codereview.chromium.org/2560253004/diff/20001/third_party/WebKit/LayoutTests/intersection-observer/client-rect.html File third_party/WebKit/LayoutTests/intersection-observer/client-rect.html (right): https://codereview.chromium.org/2560253004/diff/20001/third_party/WebKit/LayoutTests/intersection-observer/client-rect.html#newcode15 third_party/WebKit/LayoutTests/intersection-observer/client-rect.html:15: iframe.onload = function() { On 2016/12/14 13:42:16, foolip wrote: ...
4 years ago (2016-12-14 19:57:02 UTC) #11
foolip
https://codereview.chromium.org/2560253004/diff/20001/third_party/WebKit/LayoutTests/intersection-observer/client-rect.html File third_party/WebKit/LayoutTests/intersection-observer/client-rect.html (right): https://codereview.chromium.org/2560253004/diff/20001/third_party/WebKit/LayoutTests/intersection-observer/client-rect.html#newcode10 third_party/WebKit/LayoutTests/intersection-observer/client-rect.html:10: setTimeout(f); On 2016/12/14 19:54:11, szager1 wrote: > On 2016/12/14 ...
4 years ago (2016-12-14 22:17:57 UTC) #12
szager1
PTAL, I have restructured the tests extensively. Common code is now in resources/intersection-observer-test-utils.js. Most tests ...
3 years, 12 months ago (2016-12-22 19:55:26 UTC) #14
szager1
New Year's ping.
3 years, 11 months ago (2017-01-03 23:00:02 UTC) #19
szager1
Bueller? Bueller? Bueller?
3 years, 11 months ago (2017-01-11 03:51:00 UTC) #22
foolip
On 2017/01/11 03:51:00, szager1 wrote: > Bueller? > > Bueller? > > Bueller? Happy new ...
3 years, 11 months ago (2017-01-11 11:12:02 UTC) #23
foolip
Comments on the framework before lunch, more coming. https://codereview.chromium.org/2560253004/diff/60001/third_party/WebKit/LayoutTests/intersection-observer/cross-origin-iframe.html File third_party/WebKit/LayoutTests/intersection-observer/cross-origin-iframe.html (right): https://codereview.chromium.org/2560253004/diff/60001/third_party/WebKit/LayoutTests/intersection-observer/cross-origin-iframe.html#newcode36 third_party/WebKit/LayoutTests/intersection-observer/cross-origin-iframe.html:36: waitForNotification(function() ...
3 years, 11 months ago (2017-01-11 11:42:33 UTC) #24
foolip
lgtm % many nits and suggestions, take as many as you like :) I think ...
3 years, 11 months ago (2017-01-11 13:42:54 UTC) #25
szager1
https://codereview.chromium.org/2560253004/diff/60001/third_party/WebKit/LayoutTests/intersection-observer/cross-origin-iframe.html File third_party/WebKit/LayoutTests/intersection-observer/cross-origin-iframe.html (right): https://codereview.chromium.org/2560253004/diff/60001/third_party/WebKit/LayoutTests/intersection-observer/cross-origin-iframe.html#newcode36 third_party/WebKit/LayoutTests/intersection-observer/cross-origin-iframe.html:36: waitForNotification(function() { iframe.contentWindow.postMessage("", "*"); }, On 2017/01/11 11:42:33, foolip_slow_very_sorry ...
3 years, 11 months ago (2017-01-23 23:18:05 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2560253004/80001
3 years, 11 months ago (2017-01-23 23:19:00 UTC) #29
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/a2933a3bfccbc547107f31eb878c86d9e79ed61d
3 years, 11 months ago (2017-01-24 00:36:07 UTC) #32
foolip
3 years, 11 months ago (2017-01-24 10:50:36 UTC) #33
Message was sent while issue was closed.
https://codereview.chromium.org/2560253004/diff/60001/third_party/WebKit/Layo...
File third_party/WebKit/LayoutTests/intersection-observer/multiple-targets.html
(right):

https://codereview.chromium.org/2560253004/diff/60001/third_party/WebKit/Layo...
third_party/WebKit/LayoutTests/intersection-observer/multiple-targets.html:37:
assert_true(!!target1, "target1 exists.");
On 2017/01/23 23:18:03, szager1 wrote:
> On 2017/01/11 13:42:53, foolip_slow_very_sorry wrote:
> > There are a lot of these. Would a single test that observer.observe(null)
> throws
> > TypeError not suffice to catch typos in the IDs used to find these elements?
> 
> I didn't have these asserts originally, but in a previous comment, you
suggested
> that I assert() anything that could possibly fail.  I'm not sure what you
want.

I'm not sure which comment that was, but in any case I apologize for failing to
communicate.

I might not have this well thought out, it seems I have two ideas that are in
tension. First, it can be good to have some preconditions that prove that
everything is in the state that the rest of the test assumes. The canonical case
would be when checking that an exceptions isn't thrown or an event isn't fired
in some special scenario, as small typos could cause the test to pass for the
wrong reason. Second, it's nice with as little boilerplate as possible, so that
the interesting bits stand out more, so I remove things that would obviously
cause the test to fail anyway.

Here observer.observe(target1) will throw if target1 is not an Element, but
that's really not obvious from the call site. So, OK either way. If there isn't
already a test for observer.observe(null) throwing, that might be a nice
addition though, bugs of that nature are pretty common.

Powered by Google App Engine
This is Rietveld 408576698