Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event.html

Issue 2375413002: Remove timing dependency to document onload in dialog-close-event.html (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check close event is not called sync Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event.html
index def58eae81d3b9014b3394cf7bd6f5188c5c3c31..ca843ec67b452fb5b481c37d6563050e4da9e451 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event.html
@@ -7,6 +7,7 @@
<dialog></dialog>
<script>
description("Test that dialog receives a close event upon closing.");
+jsTestIsAsync = true;
document.addEventListener('close', function(event) {
testFailed("The 'close' event unexpectedly bubbled.");
@@ -16,16 +17,20 @@ closedCount = 0;
dialog = document.querySelector('dialog');
dialog.addEventListener('close', function(event) {
closedCount++;
- self = this;
- shouldBe('self', 'dialog');
+ selfDialog = this;
hiroshige 2016/09/29 10:46:00 |self| is renamed because it conflicts with js-tes
+ shouldBe('selfDialog', 'dialog');
shouldBeFalse('dialog.open');
shouldBeFalse('event.cancelable');
event.preventDefault();
- if (closedCount < 2) {
+ if (closedCount == 1) {
dialog.show();
dialog.close();
- };
+ // dialog's close event handler shouldn't be called synchronously.
+ shouldBe('closedCount', '1');
+ } else if (closedCount == 2) {
+ finishJSTest();
+ }
});
dialog.show();
@@ -33,8 +38,9 @@ dialog.close();
// Verify that preventDefault() didn't cancel closing.
shouldBeFalse('dialog.open');
-// FIXME: This should be removed.
-// shouldBe('closedCount', '2');
+
+// dialog's close event handler shouldn't be called synchronously.
+shouldBe('closedCount', '0');
</script>
</body>
</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698