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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-initEvent.html

Issue 2273143002: Update web-platform-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update baseline Created 4 years, 4 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
Index: third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-initEvent.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-initEvent.html b/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-initEvent.html
index 28f7faf349e79df009107dfdfd6c679f92d868d7..85abdff2fe7bdb94bee9dfc6b5f992e1da840d6f 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-initEvent.html
+++ b/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-initEvent.html
@@ -13,7 +13,7 @@ booleans.forEach(function(bubbles) {
e.initEvent("type", bubbles, cancelable)
// Step 3.
- // Can't test the stop propagation flag and stop immediate propagation flag.
+ // Stop (immediate) propagation flag is tested later
assert_equals(e.defaultPrevented, false, "defaultPrevented")
// Step 4.
assert_equals(e.isTrusted, false, "isTrusted")
@@ -78,30 +78,27 @@ async_test(function() {
this.done()
}, "Calling initEvent must not have an effect during dispatching.")
-async_test(function() {
+test(function() {
var e = document.createEvent("Event")
- e.initEvent("type", false, false)
e.stopPropagation()
-
+ e.initEvent("type", false, false)
var target = document.createElement("div")
- target.addEventListener("type", this.step_func(function() {
- assert_unreached("")
- }), false)
- assert_equals(target.dispatchEvent(e), true, "dispatchEvent must return true")
- assert_equals(target.dispatchEvent(e), true, "dispatchEvent must return true")
+ var called = false
+ target.addEventListener("type", function() { called = true }, false)
+ assert_true(target.dispatchEvent(e), "dispatchEvent must return true")
+ assert_true(called, "Listener must be called")
+}, "Calling initEvent must unset the stop propagation flag.")
+test(function() {
+ var e = document.createEvent("Event")
+ e.stopImmediatePropagation()
e.initEvent("type", false, false)
- var called = false
var target = document.createElement("div")
- target.addEventListener("type", this.step_func(function() {
- called = true
- }), false)
- assert_false(called)
- assert_equals(target.dispatchEvent(e), true, "dispatchEvent must return true")
- assert_true(called)
-
- this.done()
-}, "Calling initEvent must unset the stop propagation flag.")
+ var called = false
+ target.addEventListener("type", function() { called = true }, false)
+ assert_true(target.dispatchEvent(e), "dispatchEvent must return true")
+ assert_true(called, "Listener must be called")
+}, "Calling initEvent must unset the stop immediate propagation flag.")
async_test(function() {
var e = document.createEvent("Event")

Powered by Google App Engine
This is Rietveld 408576698