| 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 fa617c543d471d8521e8107352035dd3501bd0a0..5f9c1b1fa3be8f5c9797990b7e55b255bc72d60d 100644
|
| --- a/chrome/test/data/webui/cr_elements/cr_dialog_test.js
|
| +++ b/chrome/test/data/webui/cr_elements/cr_dialog_test.js
|
| @@ -14,13 +14,16 @@ suite('cr-dialog', function() {
|
| <div class="body"><button>button</button></div>
|
| </dialog>`;
|
|
|
| - assertFalse(document.activeElement.matches('div.title'));
|
| - assertFalse(document.activeElement.matches('button'));
|
| + var dialog = document.body.querySelector('dialog');
|
| + var button = document.body.querySelector('button');
|
|
|
| - document.body.querySelector('dialog').showModal();
|
| + assertNotEquals(dialog, document.activeElement);
|
| + assertNotEquals(button, document.activeElement);
|
|
|
| - expectTrue(document.activeElement.matches('div.title'));
|
| - expectFalse(document.activeElement.matches('button'));
|
| + dialog.showModal();
|
| +
|
| + expectEquals(dialog, document.activeElement);
|
| + expectNotEquals(button, document.activeElement);
|
| });
|
|
|
| test('focuses [autofocus] instead of title when present', function() {
|
| @@ -30,12 +33,15 @@ suite('cr-dialog', function() {
|
| <div class="body"><button autofocus>button</button></div>
|
| </dialog>`;
|
|
|
| - assertFalse(document.activeElement.matches('button'));
|
| - assertFalse(document.activeElement.matches('div.title'));
|
| + var dialog = document.body.querySelector('dialog');
|
| + var button = document.body.querySelector('button');
|
| +
|
| + assertNotEquals(dialog, document.activeElement);
|
| + assertNotEquals(button, document.activeElement);
|
|
|
| - document.body.querySelector('dialog').showModal();
|
| + dialog.showModal();
|
|
|
| - expectTrue(document.activeElement.matches('button'));
|
| - expectFalse(document.activeElement.matches('div.title'));
|
| + expectNotEquals(dialog, document.activeElement);
|
| + expectEquals(button, document.activeElement);
|
| });
|
| });
|
|
|