|
36 | 36 | 'The innerHTML of <selectedoption> should initially match the innerHTML of the selected <option>.');
|
37 | 37 |
|
38 | 38 | select.value = 'two';
|
| 39 | + await new Promise(queueMicrotask); |
39 | 40 | assert_equals(selectedOption.innerHTML, optionTwo.innerHTML,
|
40 | 41 | 'The innerHTML of <selectedoption> should change after the selected option is changed.');
|
41 | 42 |
|
42 | 43 | spanTwo.textContent = 'new span';
|
| 44 | + await new Promise(queueMicrotask); |
43 | 45 | assert_equals(selectedOption.innerHTML, optionTwo.innerHTML,
|
44 | 46 | '<selectedoption> should respond to text content changes.');
|
45 | 47 |
|
46 | 48 | spanTwo.appendChild(document.createElement('div'));
|
| 49 | + await new Promise(queueMicrotask); |
47 | 50 | assert_equals(selectedOption.innerHTML, optionTwo.innerHTML,
|
48 | 51 | '<selectedoption> should respond to new elements being added to descendants.');
|
49 | 52 |
|
50 | 53 | spanTwo.setAttribute('data-foo', 'bar');
|
| 54 | + await new Promise(queueMicrotask); |
51 | 55 | assert_equals(selectedOption.innerHTML, optionTwo.innerHTML,
|
52 | 56 | '<selectedoption> should respond to attributes being added to descendants.');
|
53 | 57 |
|
54 | 58 | form.reset();
|
| 59 | + await new Promise(queueMicrotask); |
55 | 60 | assert_equals(select.value, 'one',
|
56 | 61 | 'form.reset() should change the selects value to one.');
|
57 | 62 | assert_equals(selectedOption.innerHTML, optionOne.innerHTML,
|
|
60 | 65 | await test_driver.bless();
|
61 | 66 | select.showPicker();
|
62 | 67 | await test_driver.click(optionTwo);
|
| 68 | + await new Promise(queueMicrotask); |
63 | 69 | assert_equals(select.value, 'two',
|
64 | 70 | 'Clicking on another option should change select.value.');
|
65 | 71 | assert_equals(selectedOption.innerHTML, optionTwo.innerHTML,
|
66 | 72 | 'Clicking on an option element should update the <selectedoption>.');
|
67 | 73 |
|
68 | 74 | selectedOption.remove();
|
| 75 | + await new Promise(queueMicrotask); |
69 | 76 | assert_equals(selectedOption.innerHTML, '',
|
70 | 77 | 'Removing the <selectedoption> from the <select> should make it clear its contents.');
|
71 | 78 | button.appendChild(selectedOption);
|
72 | 79 | assert_equals(selectedOption.innerHTML, optionTwo.innerHTML,
|
73 | 80 | 'Re-inserting the <selectedoption> should make it update its contents.');
|
74 | 81 |
|
75 | 82 | optionTwo.remove();
|
| 83 | + await new Promise(queueMicrotask); |
76 | 84 | assert_equals(selectedOption.innerHTML, optionOne.innerHTML,
|
77 | 85 | 'The innerHTML of <selectedoption> should be updated in response to selected <option> removal.');
|
78 | 86 | optionOne.remove();
|
|
0 commit comments