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

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

Issue 1044203004: [Storage] Cache storage inspection on all the frames! (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comments Created 5 years, 8 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/http/tests/inspector/inspector-test.js
diff --git a/LayoutTests/http/tests/inspector/inspector-test.js b/LayoutTests/http/tests/inspector/inspector-test.js
index 353c0460ebe5af536200f2225636ad8dab0b982f..72d4ad411d15b13a5dcf38edcd75045462e7fbfc 100644
--- a/LayoutTests/http/tests/inspector/inspector-test.js
+++ b/LayoutTests/http/tests/inspector/inspector-test.js
@@ -429,6 +429,33 @@ InspectorTest.addSniffer = function(receiver, methodName, override, opt_sticky)
};
}
+InspectorTest.addSnifferPromise = function(receiver, methodName)
+{
+ return new Promise(function (resolve, reject) {
+ var original = receiver[methodName];
pfeldman 2015/04/10 12:35:33 poor indent.
dmurph 2015/04/13 18:23:03 Removed.
+ if (typeof original !== "function") {
+ reject("Cannot find method to override: " + methodName);
+ return;
+ }
+
+ receiver[methodName] = function(var_args) {
+ try {
+ var result = original.apply(this, arguments);
+ } finally {
+ receiver[methodName] = original;
+ }
+ // In case of exception the override won't be called.
+ try {
+ Array.prototype.push.call(arguments, result);
+ resolve.apply(this, arguments);
+ } catch (e) {
+ reject("Exception in overriden method '" + methodName + "': " + e);
+ }
+ return result;
+ };
+ });
+}
+
InspectorTest.addConsoleSniffer = function(override, opt_sticky)
{
InspectorTest.addSniffer(WebInspector.ConsoleModel.prototype, "addMessage", override, opt_sticky);

Powered by Google App Engine
This is Rietveld 408576698