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

Side by Side Diff: LayoutTests/http/tests/inspector/resources/extension-main.js

Issue 1176133003: DevTools: deflake extensions-resources.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: extracted loaded resources into an iframe Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector/extensions/extensions-resources.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 function trimURL(url) 1 function trimURL(url)
2 { 2 {
3 if (!url) 3 if (!url)
4 return; 4 return;
5 if (/^data:/.test(url)) 5 if (/^data:/.test(url))
6 return url.replace(/,.*$/, "..."); 6 return url.replace(/,.*$/, "...");
7 return url.replace(/.*\//, ".../"); 7 return url.replace(/.*\//, ".../");
8 } 8 }
9 9
10 function dumpObject(object, nondeterministicProps, prefix, firstLinePrefix) 10 function dumpObject(object, nondeterministicProps, prefix, firstLinePrefix)
(...skipping 30 matching lines...) Expand all
41 output(result[i]); 41 output(result[i]);
42 } else 42 } else
43 output(result); 43 output(result);
44 } 44 }
45 45
46 function evaluateOnFrontend(expression, callback) 46 function evaluateOnFrontend(expression, callback)
47 { 47 {
48 window._extensionServerForTests.sendRequest({ command: "evaluateForTestInFro ntEnd", expression: expression }, callback); 48 window._extensionServerForTests.sendRequest({ command: "evaluateForTestInFro ntEnd", expression: expression }, callback);
49 } 49 }
50 50
51 function invokePageFunctionAsync(functionName, callback)
52 {
53 evaluateOnFrontend("InspectorTest.invokePageFunctionAsync('" + functionName + "', reply)", callback);
54 }
55
51 function output(message) 56 function output(message)
52 { 57 {
53 evaluateOnFrontend("InspectorTest.addResult(unescape('" + escape(message) + "'));"); 58 evaluateOnFrontend("InspectorTest.addResult(unescape('" + escape(message) + "'));");
54 } 59 }
55 60
56 function onError(event) 61 function onError(event)
57 { 62 {
58 window.removeEventListener("error", onError); 63 window.removeEventListener("error", onError);
59 output("Uncaught exception in extension context: " + event.message + " [" + event.filename + ":" + event.lineno + "]"); 64 output("Uncaught exception in extension context: " + event.message + " [" + event.filename + ":" + event.lineno + "]");
60 evaluateOnFrontend("InspectorTest.completeTest();"); 65 evaluateOnFrontend("InspectorTest.completeTest();");
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 nextTest.call(this); 116 nextTest.call(this);
112 } 117 }
113 return callbackWrapper; 118 return callbackWrapper;
114 } 119 }
115 120
116 function bind(func, thisObject) 121 function bind(func, thisObject)
117 { 122 {
118 var args = Array.prototype.slice.call(arguments, 2); 123 var args = Array.prototype.slice.call(arguments, 2);
119 return function() { return func.apply(thisObject, args.concat(Array.prototyp e.slice.call(arguments, 0))); }; 124 return function() { return func.apply(thisObject, args.concat(Array.prototyp e.slice.call(arguments, 0))); };
120 } 125 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/extensions/extensions-resources.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698