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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/html/webappapis/scripting/event-loops/microtask_after_script.html

Issue 2303013002: Add UMA metric to track usage of sending a mousedown to select elements. (Closed)
Patch Set: W3C auto test import CL. 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <head>
3 <link rel=author title="Aleks Totic" href="mailto:atotic@chromium.org">
4 <link rel=help href="https://html.spec.whatwg.org/#clean-up-after-running-script ">
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 <script src="resources/common.js"></script>
8 </head>
9 <body style="height:2000px;">
10 <script>
11 /*
12 promise 1, promise 2 execute immediately after script tag
13 promise 1 child executes immediately after promise 2.
14
15 Relevant specs:
16
17 https://html.spec.whatwg.org/#clean-up-after-running-script
18 If the JavaScript execution context stack is now empty, perform a microtask chec kpoint.
19
20 https://html.spec.whatwg.org/#perform-a-microtask-checkpoint
21 "perform a microtask checkpoint" runs in a loop until all microtasks have been d elivered.
22 */
23
24 var test = async_test("Microtask immediately after script");
25
26 var events = [];
27
28 Promise.resolve()
29 .then(function() {
30 events.push("promise 1");
31 return Promise.resolve();
32 })
33 .then(function() {
34 test.step(function() {
35 events.push("promise 1 child");
36 assert_array_equals(events, ["promise 1", "promise 2", "promise 1 child" ]);
37 test.done();
38 });
39 });
40 Promise.resolve()
41 .then(function() {
42 events.push("promise 2");
43 });
44
45 // Set up events that must be executed after Promise.
46 window.setTimeout(function() {
47 events.push('timeout');
48 }, 0);
49 window.addEventListener('scroll', function() {
50 events.push('scroll');
51 });
52 window.scrollBy(0,10);
53
54 </script>
55 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698