| Index: chrome/test/data/webui/cr_elements/cr_dialog_test.js
|
| diff --git a/chrome/test/data/webui/cr_elements/cr_dialog_test.js b/chrome/test/data/webui/cr_elements/cr_dialog_test.js
|
| index c61de467ea981a9d66a9842d3a3d40d5e9602bbf..41987dd2d391891460b85490afc7262a36be9d58 100644
|
| --- a/chrome/test/data/webui/cr_elements/cr_dialog_test.js
|
| +++ b/chrome/test/data/webui/cr_elements/cr_dialog_test.js
|
| @@ -145,6 +145,29 @@ suite('cr-dialog', function() {
|
| expectEquals(button, document.activeElement);
|
| });
|
|
|
| + // Ensuring that intersectionObserver does not fire any callbacks before the
|
| + // dialog has been opened.
|
| + test('body scrollable border not added before modal shown', function(done) {
|
| + document.body.innerHTML = `
|
| + <dialog is="cr-dialog" show-scroll-borders>
|
| + <div class="title">title</div>
|
| + <div class="body">body</div>
|
| + </dialog>`;
|
| +
|
| + var dialog = document.body.querySelector('dialog');
|
| + assertFalse(dialog.open);
|
| + var bodyContainer = dialog.$$('.body-container');
|
| + assertTrue(!!bodyContainer);
|
| +
|
| + // Waiting for 1ms because IntersectionObserver fires one message loop after
|
| + // dialog.attached.
|
| + setTimeout(function() {
|
| + assertFalse(bodyContainer.classList.contains('top-scrollable'));
|
| + assertFalse(bodyContainer.classList.contains('bottom-scrollable'));
|
| + done();
|
| + }, 1);
|
| + });
|
| +
|
| test('dialog body scrollable border when appropriate', function(done) {
|
| document.body.innerHTML = `
|
| <dialog is="cr-dialog" show-scroll-borders>
|
|
|