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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/Tests.js

Issue 2376583002: DevTools: remove WI.NetworkMapping.networkURL (Closed)
Patch Set: do not blackbox fs uiSourceCodes Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 350
351 function checkScriptsPanel() { 351 function checkScriptsPanel() {
352 test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html"]), "So me scripts are missing."); 352 test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html"]), "So me scripts are missing.");
353 checkNoDuplicates(); 353 checkNoDuplicates();
354 test.releaseControl(); 354 test.releaseControl();
355 } 355 }
356 356
357 function checkNoDuplicates() { 357 function checkNoDuplicates() {
358 var uiSourceCodes = test.nonAnonymousUISourceCodes_(); 358 var uiSourceCodes = test.nonAnonymousUISourceCodes_();
359 for (var i = 0; i < uiSourceCodes.length; i++) { 359 for (var i = 0; i < uiSourceCodes.length; i++) {
360 var scriptName = WebInspector.networkMapping.networkURL(uiSourceCode s[i]);
361 for (var j = i + 1; j < uiSourceCodes.length; j++) 360 for (var j = i + 1; j < uiSourceCodes.length; j++)
362 test.assertTrue(scriptName !== WebInspector.networkMapping.netwo rkURL(uiSourceCodes[j]), "Found script duplicates: " + test.uiSourceCodesToStrin g_(uiSourceCodes)); 361 test.assertTrue(uiSourceCodes[i].url() !== uiSourceCodes[j].url( ), "Found script duplicates: " + test.uiSourceCodesToString_(uiSourceCodes));
363 } 362 }
364 } 363 }
365 364
366 this.showPanel("sources").then(function() { 365 this.showPanel("sources").then(function() {
367 test._waitUntilScriptsAreParsed( 366 test._waitUntilScriptsAreParsed(
368 ["debugger_test_page.html"], 367 ["debugger_test_page.html"],
369 function() { 368 function() {
370 checkNoDuplicates(); 369 checkNoDuplicates();
371 setTimeout(switchToElementsTab, 0); 370 setTimeout(switchToElementsTab, 0);
372 }); 371 });
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 1062
1064 /** 1063 /**
1065 * Serializes array of uiSourceCodes to string. 1064 * Serializes array of uiSourceCodes to string.
1066 * @param {!Array.<!WebInspectorUISourceCode>} uiSourceCodes 1065 * @param {!Array.<!WebInspectorUISourceCode>} uiSourceCodes
1067 * @return {string} 1066 * @return {string}
1068 */ 1067 */
1069 TestSuite.prototype.uiSourceCodesToString_ = function(uiSourceCodes) 1068 TestSuite.prototype.uiSourceCodesToString_ = function(uiSourceCodes)
1070 { 1069 {
1071 var names = []; 1070 var names = [];
1072 for (var i = 0; i < uiSourceCodes.length; i++) 1071 for (var i = 0; i < uiSourceCodes.length; i++)
1073 names.push('"' + WebInspector.networkMapping.networkURL(uiSourceCodes[i] ) + '"'); 1072 names.push('"' + uiSourceCodes[i].url() + '"');
1074 return names.join(","); 1073 return names.join(",");
1075 }; 1074 };
1076 1075
1077 1076
1078 /** 1077 /**
1079 * Returns all loaded non anonymous uiSourceCodes. 1078 * Returns all loaded non anonymous uiSourceCodes.
1080 * @return {!Array.<!WebInspectorUISourceCode>} 1079 * @return {!Array.<!WebInspectorUISourceCode>}
1081 */ 1080 */
1082 TestSuite.prototype.nonAnonymousUISourceCodes_ = function() 1081 TestSuite.prototype.nonAnonymousUISourceCodes_ = function()
1083 { 1082 {
1084 function filterOutAnonymous(uiSourceCode) 1083 /**
1085 { 1084 * @param {!WebInspector.UISourceCode} uiSourceCode
1086 return !!WebInspector.networkMapping.networkURL(uiSourceCode); 1085 */
1087 }
1088
1089 function filterOutService(uiSourceCode) 1086 function filterOutService(uiSourceCode)
1090 { 1087 {
1091 return !uiSourceCode.isFromServiceProject(); 1088 return !uiSourceCode.isFromServiceProject();
1092 } 1089 }
1093 1090
1094 var uiSourceCodes = WebInspector.workspace.uiSourceCodes(); 1091 var uiSourceCodes = WebInspector.workspace.uiSourceCodes();
1095 uiSourceCodes = uiSourceCodes.filter(filterOutService); 1092 return uiSourceCodes.filter(filterOutService);
1096 return uiSourceCodes.filter(filterOutAnonymous);
1097 }; 1093 };
1098 1094
1099 1095
1100 /* 1096 /*
1101 * Evaluates the code in the console as if user typed it manually and invokes 1097 * Evaluates the code in the console as if user typed it manually and invokes
1102 * the callback when the result message is received and added to the console. 1098 * the callback when the result message is received and added to the console.
1103 * @param {string} code 1099 * @param {string} code
1104 * @param {function(string)} callback 1100 * @param {function(string)} callback
1105 */ 1101 */
1106 TestSuite.prototype.evaluateInConsole_ = function(code, callback) 1102 TestSuite.prototype.evaluateInConsole_ = function(code, callback)
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 /** 1207 /**
1212 * Key event with given key identifier. 1208 * Key event with given key identifier.
1213 */ 1209 */
1214 TestSuite.createKeyEvent = function(key) 1210 TestSuite.createKeyEvent = function(key)
1215 { 1211 {
1216 return new KeyboardEvent("keydown", {bubbles: true, cancelable:true, key: ke y}); 1212 return new KeyboardEvent("keydown", {bubbles: true, cancelable:true, key: ke y});
1217 }; 1213 };
1218 1214
1219 window.uiTests = new TestSuite(window.domAutomationController); 1215 window.uiTests = new TestSuite(window.domAutomationController);
1220 })(window); 1216 })(window);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698