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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js

Issue 2879503002: [Devtools] Added product entry tests for network
Patch Set: [Devtools] Added product entry tests for network Created 3 years, 7 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/http/tests/inspector/inspector-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
index 3f06fbf7460a19b31805a6c78a95db6c45c34ba9..6009ccbf91e967d3811c3d96199d38c3dc588bb1 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
@@ -427,6 +427,27 @@ InspectorTest.dumpNavigatorViewInMode = function(view, mode)
InspectorTest.dumpNavigatorView(view);
}
+/**
+ * @param {symbol} event
+ * @param {!Common.Object} obj
+ * @param {(function(?):boolean)|undefined}
+ * @return {!Promise}
+ */
+InspectorTest.waitEventListener = function(event, obj, condition = undefined)
allada 2017/05/10 22:25:01 There are a few places in this file that could use
dgozman 2017/05/10 22:57:13 Paul is adding .once(), will it work in most cases
+{
+ condition = condition || function() { return true;};
+ return new Promise(resolve => {
+ obj.addEventListener(event, onEventFired);
+
+ function onEventFired(event) {
+ if (!condition(event.data))
+ return;
+ obj.removeEventListener(event, onEventFired);
+ resolve(event.data);
+ }
+ });
+}
+
InspectorTest.waitForUISourceCode = function(urlSuffix, projectType)
{
function matches(uiSourceCode)

Powered by Google App Engine
This is Rietveld 408576698