Commit 41b28682 authored by Fergal Daly's avatar Fergal Daly Committed by Commit Bot

Fix some style issues with the virtual scroller's test .mjs

Just running clang-format

Change-Id: I855e9fd343c063d787f46a352895bfa834a97b13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1781131Reviewed-by: default avatarRakina Zata Amni <rakina@chromium.org>
Reviewed-by: default avatarFergal Daly <fergal@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693005}
parent 4e6be429
......@@ -207,8 +207,8 @@ export class VisibilityManager {
// which would involve an unknown number of forced layouts, we
// come back next frame and try to make it better. We know we can
// stop when we didn't hide or reveal any elements.
if (this.#syncRevealed(newRevealed) +
this.#syncObserved(newObserved) > 0) {
if (this.#syncRevealed(newRevealed) + this.#syncObserved(newObserved) >
0) {
this.scheduleSync();
}
}
......
......@@ -25,8 +25,8 @@ export function div(id) {
*/
export function largeDiv(id) {
const large = div(id);
large.style.height = "5000px";
large.style.border = "solid";
large.style.height = '5000px';
large.style.border = 'solid';
return large;
}
......@@ -60,7 +60,7 @@ export function withElement(name, callback) {
*
* This includes a hack to wait 1s to give the virtual-scroller
* elements time to settle.
*/
*/
export function stopWaiting() {
setTimeout(() => {
document.documentElement.classList.remove('reftest-wait');
......@@ -81,7 +81,7 @@ export function words(n) {
/**
* Allow the next |n| frames to end and then call |callback| ASAP in
* the following frame.
*/
*/
export function inNFrames(n, callback) {
if (n == 0) {
window.setTimeout(callback, 0);
......@@ -95,7 +95,7 @@ export function inNFrames(n, callback) {
/**
* Allow the current frame to end and then call |callback| asap in the
* next frame.
*/
*/
export function nextFrame(callback) {
inNFrames(1, callback);
}
......@@ -33,9 +33,9 @@ export function testLargeChild(target) {
// page reloads.
document.body.scrollTo(0, 0);
helpers.nextFrame(() => {
const largeChild = helpers.largeDiv("largeChild");
const largeChild = helpers.largeDiv('largeChild');
target.appendChild(largeChild);
const child = helpers.div("child");
const child = helpers.div('child');
target.appendChild(child);
// Give the scroller time to settle.
......@@ -53,11 +53,11 @@ export function testLargeChildComment(target) {
// page reloads.
document.body.scrollTo(0, 0);
helpers.nextFrame(() => {
const largeChild = helpers.largeDiv("largeChild");
const largeChild = helpers.largeDiv('largeChild');
target.appendChild(largeChild);
// Ensure that non-element nodes don't cause problems.
target.appendChild(document.createComment("comment"));
target.appendChild(helpers.div("child"));
target.appendChild(document.createComment('comment'));
target.appendChild(helpers.div('child'));
// Give the scroller time to settle.
helpers.inNFrames(10, () => {
......@@ -114,9 +114,9 @@ export function testScrollFromOffScreen(target) {
helpers.nextFrame(() => {
// The page is a large element (much bigger than the page)
// followed by the scroller. We then scroll down to the scroller.
const largeSibling = helpers.largeDiv("large");
const largeSibling = helpers.largeDiv('large');
target.before(largeSibling);
const child = helpers.div("child");
const child = helpers.div('child');
target.appendChild(child);
// Give the scroller time to settle.
......@@ -130,18 +130,18 @@ export function testScrollFromOffScreen(target) {
/**
* Runs |test| with a <virtual-scroller>, waiting until the custom element is
* defined.
*/
*/
export function withVirtualScroller(test) {
customElements.whenDefined('virtual-scroller').then(() => {
runTest("virtual-scroller", test);
runTest('virtual-scroller', test);
});
}
/**
* Runs |test| with a <div>.
*/
*/
export function withDiv(test) {
runTest("div", test);
runTest('div', test);
}
function runTest(elementName, test) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment