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

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

Issue 2164763002: DevTools: bring back properties defined on prototype to object dumps in extension tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/extensions/extensions-api-expected.txt » ('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)
11 { 11 {
12 prefix = prefix || ""; 12 prefix = prefix || "";
13 firstLinePrefix = firstLinePrefix || prefix; 13 firstLinePrefix = firstLinePrefix || prefix;
14 output(firstLinePrefix + "{"); 14 output(firstLinePrefix + "{");
15 var propertyNames = Object.keys(object); 15 var propertyNames = [];
16 for (var property in object)
17 propertyNames.push(property);
16 propertyNames.sort(); 18 propertyNames.sort();
17 19
18 for (var i = 0; i < propertyNames.length; ++i) { 20 for (var i = 0; i < propertyNames.length; ++i) {
19 var prop = propertyNames[i]; 21 var prop = propertyNames[i];
20 var prefixWithName = prefix + " " + prop + " : "; 22 var prefixWithName = prefix + " " + prop + " : ";
21 var propValue = object[prop]; 23 var propValue = object[prop];
22 if (nondeterministicProps && prop in nondeterministicProps) { 24 if (nondeterministicProps && prop in nondeterministicProps) {
23 var value = nondeterministicProps[prop] === "url" ? trimURL(propValu e) : "<" + typeof propValue + ">"; 25 var value = nondeterministicProps[prop] === "url" ? trimURL(propValu e) : "<" + typeof propValue + ">";
24 output(prefixWithName + value); 26 output(prefixWithName + value);
25 } else if (typeof propValue === "object" && propValue != null) 27 } else if (typeof propValue === "object" && propValue != null)
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 nextTest.call(this); 118 nextTest.call(this);
117 } 119 }
118 return callbackWrapper; 120 return callbackWrapper;
119 } 121 }
120 122
121 function bind(func, thisObject) 123 function bind(func, thisObject)
122 { 124 {
123 var args = Array.prototype.slice.call(arguments, 2); 125 var args = Array.prototype.slice.call(arguments, 2);
124 return function() { return func.apply(thisObject, args.concat(Array.prototyp e.slice.call(arguments, 0))); }; 126 return function() { return func.apply(thisObject, args.concat(Array.prototyp e.slice.call(arguments, 0))); };
125 } 127 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/extensions/extensions-api-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698