Changeset 65799 in webkit
- Timestamp:
- Aug 23, 2010 2:49:29 AM (14 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r65798 r65799 1 2010-08-23 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: add DOM breakpoints test 6 https://bugs.webkit.org/show_bug.cgi?id=44251 7 8 * http/tests/inspector/debugger-test2.js: Added. 9 (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest): 10 (initialize_DebuggerTest.InspectorTest.startDebuggerTest): 11 (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.completeTest): 12 (initialize_DebuggerTest.InspectorTest.completeDebuggerTest): 13 (initialize_DebuggerTest.InspectorTest.waitUntilPaused): 14 (initialize_DebuggerTest.InspectorTest.resumeExecution): 15 (initialize_DebuggerTest.InspectorTest.showScriptSource): 16 (initialize_DebuggerTest.InspectorTest._scriptsAreParsed): 17 (initialize_DebuggerTest.InspectorTest._showScriptSource): 18 (initialize_DebuggerTest): 19 * http/tests/inspector/inspector-test2.js: 20 (initialize_InspectorTest): 21 (initialize_InspectorTest.): 22 (runTest.runTestInFrontend): 23 (runTest): 24 * inspector/debugger-breakpoints-not-activated-on-reload.html: 25 * inspector/dom-breakpoints-expected.txt: Added. 26 * inspector/dom-breakpoints.html: Added. 27 * platform/gtk/Skipped: 28 * platform/mac/Skipped: 29 * platform/qt/Skipped: 30 * platform/win/Skipped: 31 1 32 2010-08-23 Philippe Normand <pnormand@igalia.com> 2 33 -
trunk/LayoutTests/http/tests/inspector/inspector-test2.js
r65606 r65799 1 var initialize InspectorTest = (function(completeTestCallId) {1 var initialize_InspectorTest = (function() { 2 2 3 3 var results = []; … … 5 5 InspectorTest.completeTest = function() 6 6 { 7 InspectorBackend.didEvaluateForTestInFrontend( completeTestCallId, JSON.stringify(results));7 InspectorBackend.didEvaluateForTestInFrontend(InspectorTest.completeTestCallId, JSON.stringify(results)); 8 8 }; 9 9 … … 12 12 WebInspector.console.visible = true; 13 13 WebInspector.console.prompt.text = code; 14 WebInspector.console.promptElement.dispatchEvent(createKeyEvent("Enter")); 15 16 addSniffer(WebInspector.ConsoleView.prototype, "addMessage", 14 var event = document.createEvent("KeyboardEvent"); 15 event.initKeyboardEvent("keydown", true, true, null, "Enter", ""); 16 WebInspector.console.promptElement.dispatchEvent(event); 17 InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", 17 18 function(commandResult) { 18 19 if (callback) … … 29 30 { 30 31 InspectorBackend.reloadPage(); 31 addSniffer(WebInspector, "reset", callback);32 InspectorTest._addSniffer(WebInspector, "reset", callback); 32 33 }; 33 34 34 InspectorTest. ensureDebuggerEnabled = function(callback)35 InspectorTest.findDOMNode = function(root, filter, callback) 35 36 { 36 if (WebInspector.panels.scripts._debuggerEnabled) 37 callback(); 38 else { 39 addSniffer(WebInspector, "debuggerWasEnabled", callback); 40 WebInspector.panels.scripts._toggleDebugging(false); 37 var found = false; 38 39 if (root) 40 findDOMNode(root); 41 else 42 waitForDocument(); 43 44 function waitForDocument() 45 { 46 root = WebInspector.domAgent.document; 47 if (root) 48 findDOMNode(root); 49 else 50 InspectorTest._addSniffer(WebInspector, setDocument, waitForDocument); 51 } 52 53 function findDOMNode(node) 54 { 55 if (filter(node)) { 56 callback(node); 57 found = true; 58 } else 59 WebInspector.domAgent.getChildNodesAsync(node, processChildren); 60 61 function processChildren(children) 62 { 63 for (var i = 0; !found && children && i < children.length; ++i) 64 findDOMNode(children[i]); 65 if (!found && node === root) 66 callback(null); 67 } 41 68 } 42 69 }; 43 70 44 InspectorTest.ensureDebuggerDisabled = function(callback) 45 { 46 if (!WebInspector.panels.scripts._debuggerEnabled) 47 callback(); 48 else { 49 addSniffer(WebInspector, "debuggerWasDisabled", callback); 50 WebInspector.panels.scripts._toggleDebugging(false); 51 } 52 }; 53 54 InspectorTest.showScriptSource = function(scriptName, callback) 55 { 56 function waitForAllScripts() 57 { 58 if (scriptsAreParsed([scriptName])) 59 showScriptSource(scriptName, callback); 60 else 61 addSniffer(WebInspector, "parsedScriptSource", waitForAllScripts); 62 } 63 waitForAllScripts(); 64 }; 65 66 function createKeyEvent(keyIdentifier) 67 { 68 var evt = document.createEvent("KeyboardEvent"); 69 evt.initKeyboardEvent("keydown", true, true, null, keyIdentifier, ""); 70 return evt; 71 } 72 73 function addSniffer(receiver, methodName, override, opt_sticky) 71 InspectorTest._addSniffer = function(receiver, methodName, override, opt_sticky) 74 72 { 75 73 var original = receiver[methodName]; … … 93 91 } 94 92 95 function scriptsAreParsed(scripts)96 {97 var scriptSelect = document.getElementById("scripts-files");98 var options = scriptSelect.options;99 100 // Check that all the expected scripts are present.101 for (var i = 0; i < scripts.length; i++) {102 var found = false;103 for (var j = 0; j < options.length; j++) {104 if (options[j].text === scripts[i]) {105 found = true;106 break;107 }108 }109 if (!found)110 return false;111 }112 return true;113 };114 115 function showScriptSource(scriptName, callback)116 {117 var scriptSelect = document.getElementById("scripts-files");118 var options = scriptSelect.options;119 var scriptsPanel = WebInspector.panels.scripts;120 121 // Select page's script if it's not current option.122 var scriptResource;123 if (options[scriptSelect.selectedIndex].text === scriptName)124 scriptResource = options[scriptSelect.selectedIndex].representedObject;125 else {126 var pageScriptIndex = -1;127 for (var i = 0; i < options.length; i++) {128 if (options[i].text === scriptName) {129 pageScriptIndex = i;130 break;131 }132 }133 scriptResource = options[pageScriptIndex].representedObject;134 scriptsPanel._showScriptOrResource(scriptResource);135 }136 137 var view = scriptsPanel.visibleView;138 callback = callback.bind(null, view);139 if (!view.sourceFrame._loaded)140 addSniffer(view.sourceFrame, "setContent", callback);141 else142 callback();143 };144 145 93 }); 146 94 … … 156 104 layoutTestController.waitUntilDone(); 157 105 158 var toEvaluate = 159 "if (!window.InspectorTest) {" + 160 " var InspectorTest = {};" + 161 " (" + initializeInspectorTest + ")(" + completeTestCallId + ");" + 162 " WebInspector.showPanel('elements');" + 163 " (" + test + ")();" + 164 "}"; 106 function runTestInFrontend(initializationFunctions, testFunction, completeTestCallId) 107 { 108 if (window.InspectorTest) 109 return; 110 111 InspectorTest = {}; 112 InspectorTest.completeTestCallId = completeTestCallId; 113 114 for (var i = 0; i < initializationFunctions.length; ++i) 115 initializationFunctions[i](); 116 117 WebInspector.showPanel("elements"); 118 testFunction(); 119 } 120 121 var initializationFunctions = []; 122 for (var name in window) { 123 if (name.indexOf("initialize_") === 0 && typeof window[name] === "function") 124 initializationFunctions.push(window[name].toString()); 125 } 126 var parameters = ["[" + initializationFunctions + "]", test, completeTestCallId]; 127 var toEvaluate = "(" + runTestInFrontend + ")(" + parameters.join(", ") + ");"; 165 128 layoutTestController.evaluateInWebInspector(runTestCallId, toEvaluate); 166 129 } -
trunk/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html
r65606 r65799 2 2 <head> 3 3 <script src="../http/tests/inspector/inspector-test2.js"></script> 4 <script src="../http/tests/inspector/debugger-test2.js"></script> 4 5 <script> 5 6 … … 15 16 16 17 WebInspector.showPanel("scripts"); 17 InspectorTest. ensureDebuggerEnabled(ensureDebuggerEnabledCallback);18 InspectorTest.startDebuggerTest(startDebuggerTestCallback); 18 19 19 function ensureDebuggerEnabledCallback()20 function startDebuggerTestCallback() 20 21 { 21 InspectorTest.addResult("Debugger was enabled.");22 22 InspectorTest.showScriptSource(testName, showScriptSourceCallback); 23 23 } … … 44 44 else 45 45 InspectorTest.addResult("Error: breakpoints are activated."); 46 InspectorTest.ensureDebuggerDisabled(ensureDebuggerDisabledCallback); 47 } 48 49 function ensureDebuggerDisabledCallback() 50 { 51 InspectorTest.addResult("Debugger was disabled."); 52 InspectorTest.completeTest(); 46 InspectorTest.completeDebuggerTest(); 53 47 } 54 48 }; -
trunk/LayoutTests/platform/gtk/Skipped
r65798 r65799 5918 5918 perf/ 5919 5919 5920 # https://bugs.webkit.org/show_bug.cgi?id=43332 5921 inspector/dom-breakpoints.html 5922 5920 5923 # [GTK] r65681 broke a couple GTK+ a11y tests 5921 5924 # https://bugs.webkit.org/show_bug.cgi?id=44316 -
trunk/LayoutTests/platform/mac/Skipped
r65628 r65799 290 290 # https://bugs.webkit.org/show_bug.cgi?id=42821 291 291 animations/play-state.html 292 293 # https://bugs.webkit.org/show_bug.cgi?id=43332 294 inspector/dom-breakpoints.html -
trunk/LayoutTests/platform/qt/Skipped
r65783 r65799 105 105 fast/text/hyphenate-character.html 106 106 fast/text/hyphens.html 107 108 # https://bugs.webkit.org/show_bug.cgi?id=43332 109 inspector/dom-breakpoints.html 107 110 108 111 # =========================================================================== # -
trunk/LayoutTests/platform/win/Skipped
r65628 r65799 966 966 # https://bugs.webkit.org/show_bug.cgi?id=43458 967 967 http/tests/appcache/origin-quota.html 968 969 # https://bugs.webkit.org/show_bug.cgi?id=43332 970 inspector/dom-breakpoints.html
Note: See TracChangeset
for help on using the changeset viewer.