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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/events/Event-dispatch-redispatch.html

Issue 1529523002: Import dom/ from web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak W3CImportExpectations Created 5 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset=urf-8>
3 <title>EventTarget#dispatchEvent(): redispatching a native event</title>
4 <script src="../../../../resources/testharness.js"></script>
5 <script src="../../../../resources/testharnessreport.js"></script>
6 <div id=log></div>
7 <script>
8 async_test(function() {
9 var event;
10 document.addEventListener("DOMContentLoaded", this.step_func(function(e) {
11 assert_true(e.isTrusted, "Should be trusted when first handled");
12 event = e;
13 }), true);
14
15 window.onload = this.step_func_done(function() {
16 var received = 0;
17 var target = document.createElement("span");
18 target.addEventListener("DOMContentLoaded", this.step_func(function(e) {
19 assert_false(e.isTrusted, "Should not be trusted during redispatching");
20 ++received;
21 }), true);
22 assert_true(event.isTrusted, "Should be trusted before redispatching");
23 target.dispatchEvent(event);
24 assert_false(event.isTrusted, "Should not be trusted after redispatching");
25 assert_equals(received, 1);
26 });
27 });
28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698