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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/timeline/timeline-dispatchEvent.js

Issue 2953663003: [DevTools] Migrate inspector-protocol/{timeline,worker} tests to new harness (Closed)
Patch Set: addressed comments Created 3 years, 6 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/inspector-protocol/timeline/timeline-dispatchEvent.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/timeline/timeline-dispatchEvent.js b/third_party/WebKit/LayoutTests/inspector-protocol/timeline/timeline-dispatchEvent.js
new file mode 100644
index 0000000000000000000000000000000000000000..bf55a78ef3088ef47a60c52accca853de7a80083
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/timeline/timeline-dispatchEvent.js
@@ -0,0 +1,33 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startHTML(`
+ <div id='my-div'></div>
+ `, '');
+
+ function performAction() {
+ var div = document.querySelector('#my-div');
+ div.addEventListener('click', function(e) { }, false);
+ div.click();
+
+ var iframe = document.createElement('iframe');
+ div.appendChild(iframe);
+ return new Promise(resolve => {
+ iframe.onload = resolve;
+ iframe.src = 'blank.html';
+ });
+ }
+
+ var TracingHelper = await testRunner.loadScript('../resources/tracing-test.js');
+ var tracingHelper = new TracingHelper(testRunner, session);
+ await tracingHelper.invokeAsyncWithTracing(performAction);
+
+ var windowEventNames = [ 'click', 'beforeunload', 'unload', 'load' ];
+ for (var eventName of windowEventNames) {
+ var events = tracingHelper.filterEvents(e => e.name === 'EventDispatch' && e.args.data.type === eventName);
+ if (events.length >= 1)
+ testRunner.log('SUCCESS: found ' + eventName + ' event');
+ else
+ testRunner.log('FAIL: ' + eventName + ' event is missing; devtools.timeline events: ' + tracingHelper.formattedEvents());
+ }
+
+ testRunner.completeTest();
+})

Powered by Google App Engine
This is Rietveld 408576698