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

Unified Diff: LayoutTests/inspector/sources/debugger/resources/framework.js

Issue 304563002: DevTools: Make frameworks work with "custom" breakpoints (DOM, XHR, Events). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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: LayoutTests/inspector/sources/debugger/resources/framework.js
diff --git a/LayoutTests/inspector/sources/debugger/resources/framework.js b/LayoutTests/inspector/sources/debugger/resources/framework.js
index 930b6792320c8d2b4b634daf1c262062805d289c..68cd2d171f32e0f0616c61e27ff0fc55a6c4b140 100644
--- a/LayoutTests/inspector/sources/debugger/resources/framework.js
+++ b/LayoutTests/inspector/sources/debugger/resources/framework.js
@@ -66,3 +66,47 @@ Framework.doSomeAsyncChainCalls = function(callback)
});
Framework.schedule(func2);
}
+
+Framework.appendChild = function(parent, child)
+{
+ parent.appendChild(child);
+}
+
+Framework.sendXHR = function(url)
+{
+ var request = new XMLHttpRequest();
+ request.open("GET", url, true);
+ request.send();
+}
+
+Framework.addEventListener = function(element, eventType, listener, capture)
+{
+ function Framework_eventListener()
+ {
+ if (listener)
+ listener();
+ }
+
+ function Framework_remover()
+ {
+ element.removeEventListener(eventType, Framework_eventListener, capture);
+ }
+
+ element.addEventListener(eventType, Framework_eventListener, capture);
+ return Framework_remover;
+}
+
+Framework.bind = function(func, thisObject, var_args)
+{
+ var args = Array.prototype.slice.call(arguments, 2);
+
+ function Framework_bound(var_args)
+ {
+ return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments)));
+ }
+ Framework_bound.toString = function()
+ {
+ return "Framework_bound: " + func;
+ };
+ return Framework_bound;
+}

Powered by Google App Engine
This is Rietveld 408576698