Revision 8f1ef70886a1443ccd9980448031c88a44c3faea authored by Ben Pastene on 13 April 2018, 17:03:33 UTC, committed by Chromium WPT Sync on 13 April 2018, 17:03:33 UTC
This reverts commit 7c3d1d13f940e88ef6706fd8b5c257a81d340ed9. Reason for revert: WebviewLoginTest.Basic is still flaky on linux-chromeos-rel https://ci.chromium.org/buildbot/chromium.chromiumos/linux-chromeos-rel/6886 https://ci.chromium.org/buildbot/chromium.chromiumos/linux-chromeos-rel/6887 Original change's description: > Reland: Use PostTask to schedule cross-process postMessage forwarding. > > Changes from original attempt at https://crrev.com/c/999182: > - fix flakiness in two additional ChromeOS login tests > - fix CSP WPT tests to not depend on ordering between iframe's onload > and postMessage - see https://crbug.com/832319. > > Previously, we sent the IPC to forward a cross-process postMessage > immediately. This caused a behavioral difference from the > same-process case where the postMessage is always scheduled. Namely, > in a scenario like this: > > frame.postMessage(...); > doSomethingThatSendsIPCsToFrame(frame); > > the IPCs from JS following the postMessage would've been ordered > incorrectly, causing |frame| to see their side effects after the > postMessage dispatch in the cross-process case, whereas they would be > seen before the postMessage dispatch in the same-process case. One > example of this is frame.focus(), and another is a frame element > onload event (dispatched via FrameHostMsg_DispatchLoad) arriving after > a postMessage dispatched from an inline script while the frame was > still loading. > > To resolve these ordering concerns, this CL changes cross-process > postMessage to do a PostTask on the sender side before sending the > message to the browser process. This improves the current state of > the world, but does not yet achieve a perfect match for the IPC > ordering in the same-process case - see discussion on the bug. > > Bug: 828529 > Change-Id: I62a627c501526d09900be4f5bd2c899acf4d1e07 > Reviewed-on: https://chromium-review.googlesource.com/999182 > Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> > Reviewed-by: Daniel Cheng <dcheng@chromium.org> > Commit-Queue: Alex Moshchuk <alexmos@chromium.org> > Cr-Original-Commit-Position: refs/heads/master@{#550284} > Reviewed-on: https://chromium-review.googlesource.com/1011287 > Cr-Commit-Position: refs/heads/master@{#550621} TBR=xiyuan@chromium.org,dcheng@chromium.org,alexmos@chromium.org Change-Id: Ic0637a6038bed6e5334a26e1934bee81faad3b9e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 828529 Reviewed-on: https://chromium-review.googlesource.com/1012138 Reviewed-by: Ben Pastene <bpastene@chromium.org> Commit-Queue: Ben Pastene <bpastene@chromium.org> Cr-Commit-Position: refs/heads/master@{#550649}
1 parent 1e5a5fe
svg.html
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./resources/resizeTestHelper.js"></script>
<p>ResizeObserver svg tests</p>
<svg height="430" width="500" >
<circle cx="10" cy="10" r="5" style="fill:orange;stroke:black;stroke-width:1" />
<ellipse cx="10" cy="30" rx="5" ry="5" style="fill:orange;stroke:black;stroke-width:1"/>
<foreignObject cy="50" width="100" height="20">
<body>
<p>Here is a paragraph that requires word wrap</p>
</body>
</foreignObject>
<image xlink:href="" x="0" y="100" height="30" width="100" />
<line x1="0" y1="50" x2="20" y2="70" stroke="black" stroke-width="2"/>
<path d="M 0 100 L 100 100 L 50 150 z"
style="fill:orange;stroke:black;stroke-width:1" />
<polygon points="0,200 100,200 50,250" style="fill:orange;stroke:black;stroke-width:1" />
<polyline points="0,300 100,300 50,350" style="fill:orange;stroke:black;stroke-width:1"/>
<rect x="0" y="380" width="10" height="10" style="fill:orange; stroke:black; stroke-width:1" />
<text x="0" y="400" font-size="20">svg text tag</text>
</svg>
<script>
'use strict';
setup({allow_uncaught_exception: true});
function test0() {
let target = document.querySelector('circle');
let helper = new ResizeTestHelper(
"test0: observe svg:circle",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
return true; // Delay next step
}
},
{
setup: observer => {
target.setAttribute('r', 10);
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
}
}
]);
return helper.start();
}
function test1() {
let target = document.querySelector('ellipse');
let helper = new ResizeTestHelper(
"test1: observe svg:ellipse",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
return true; // Delay next step
}
},
{
setup: observer => {
target.setAttribute('rx', 10);
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
assert_equals(entries[0].contentRect.width, 20);
assert_equals(entries[0].contentRect.height, 10);
}
}
]);
return helper.start();
}
function test2() {
let target = document.querySelector('foreignObject');
let helper = new ResizeTestHelper(
"test2: observe svg:foreignObject",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
return true; // Delay next step
}
},
{
setup: observer => {
target.setAttribute('width', 200);
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
assert_equals(entries[0].contentRect.width, 200);
assert_equals(entries[0].contentRect.height, 20);
}
}
]);
return helper.start();
}
function test3() {
let target = document.querySelector('image');
let helper = new ResizeTestHelper(
"test3: observe svg:image",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
return true; // Delay next step
}
},
{
setup: observer => {
target.setAttribute('height', 40);
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
assert_equals(entries[0].contentRect.width, 100);
assert_equals(entries[0].contentRect.height, 40);
}
}
]);
return helper.start();
}
function test4() {
let target = document.querySelector('line');
let helper = new ResizeTestHelper(
"test4: observe svg:line",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
return true; // Delay next step
}
},
{
setup: observer => {
target.setAttribute('y2', 80);
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
assert_equals(entries[0].contentRect.width, 20);
assert_equals(entries[0].contentRect.height, 30);
}
}
]);
return helper.start();
}
function test5() {
let target = document.querySelector('path');
let helper = new ResizeTestHelper(
"test5: observe svg:path",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
return true; // Delay next step
}
},
{
setup: observer => {
target.setAttribute('d', "M 0 100 L 100 100 L 50 160 z");
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
assert_equals(entries[0].contentRect.width, 100);
assert_equals(entries[0].contentRect.height, 60);
}
}
]);
return helper.start();
}
function test6() {
let target = document.querySelector('polygon');
let helper = new ResizeTestHelper(
"test6: observe svg:path",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
return true; // Delay next step
}
},
{
setup: observer => {
target.setAttribute('points', "0,200 100,200 50,260");
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
assert_equals(entries[0].contentRect.width, 100);
assert_equals(entries[0].contentRect.height, 60);
}
}
]);
return helper.start();
}
function test7() {
let target = document.querySelector('polyline');
let helper = new ResizeTestHelper(
"test7: observe svg:polyline",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
return true; // Delay next step
}
},
{
setup: observer => {
target.setAttribute('points', "0,300 100,300 50,360");
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
assert_equals(entries[0].contentRect.width, 100);
assert_equals(entries[0].contentRect.height, 60);
}
}
]);
return helper.start();
}
function test8() {
let target = document.querySelector('rect');
let helper = new ResizeTestHelper(
"test8: observe svg:rect",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
return true; // Delay next step
}
},
{
setup: observer => {
target.setAttribute('width', "20");
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
assert_equals(entries[0].contentRect.width, 20);
assert_equals(entries[0].contentRect.height, 10);
}
}
]);
return helper.start();
}
function test9() {
let target = document.querySelector('text');
let helper = new ResizeTestHelper(
"test9: observe svg:text",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
return true; // Delay next step
}
},
{
setup: observer => {
target.setAttribute('font-size', "25");
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
}
}
]);
return helper.start();
}
function test10() {
let target = document.querySelector('svg');
let helper = new ResizeTestHelper(
"test10: observe svg:svg, top/left is 0 even with padding",
[
{
setup: observer => {
observer.observe(target);
},
notify: (entries, observer) => {
assert_equals(entries.length, 1);
assert_equals(entries[0].contentRect.top, 0);
assert_equals(entries[0].contentRect.left, 0);
}
}
]);
return helper.start();
}
let guard;
test(_ => {
assert_own_property(window, "ResizeObserver");
guard = async_test('guard');
}, "ResizeObserver implemented")
test0()
.then(() => { return test1(); })
.then(() => { return test2(); })
.then(() => { return test3(); })
.then(() => { return test4(); })
.then(() => { return test5(); })
.then(() => { return test6(); })
.then(() => { return test7(); })
.then(() => { return test8(); })
.then(() => { return test9(); })
.then(() => { return test10(); })
.then(() => { guard.done(); });
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...