diff options
author | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 15:06:57 +0000 |
---|---|---|
committer | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 15:06:57 +0000 |
commit | a2f2023d07f0ee25cc38f0dd9be5359d8c63a2a8 (patch) | |
tree | 8aa79ba1c6ff1cc62f18423c34d996d08badc3ac /webkit/glue | |
parent | a4ac1b744e4c0caef3e2a4aec035fb5ed61d245a (diff) | |
download | chromium_src-a2f2023d07f0ee25cc38f0dd9be5359d8c63a2a8.zip chromium_src-a2f2023d07f0ee25cc38f0dd9be5359d8c63a2a8.tar.gz chromium_src-a2f2023d07f0ee25cc38f0dd9be5359d8c63a2a8.tar.bz2 |
DevTools: add tests that opens Scripts panel and checks that it's populated with two inspected scripts.
Review URL: http://codereview.chromium.org/151076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/devtools/js/tests.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/webkit/glue/devtools/js/tests.js b/webkit/glue/devtools/js/tests.js index 95e76cb..ec8a522 100644 --- a/webkit/glue/devtools/js/tests.js +++ b/webkit/glue/devtools/js/tests.js @@ -238,6 +238,58 @@ TestSuite.prototype.testProfilerTab = function(controller) { }; +/** + * Tests that scripts tab can be open and populated with inspected scripts. + */ +TestSuite.prototype.testShowScriptsTab = function(controller) { + var parsedDebuggerTestPageHtml = false; + var parsedDebuggerTestJs = false; + + // Intercept parsedScriptSource calls to check that all expected scripts are + // added to the debugger. + var self = this; + var originalParsedScriptSource = WebInspector.parsedScriptSource; + WebInspector.parsedScriptSource = function(sourceID, sourceURL, source, + startingLine) { + if (sourceURL.search(/debugger_test_page.html$/) != -1) { + if (parsedDebuggerTestPageHtml) { + controller.reportFailure('Unexpected parse event: ' + sourceURL); + return; + } + parsedDebuggerTestPageHtml = true; + } else if (sourceURL.search(/debugger_test.js$/) != -1) { + if (parsedDebuggerTestJs) { + controller.reportFailure('Unexpected parse event: ' + sourceURL); + return; + } + parsedDebuggerTestJs = true; + } else { + controller.reportFailure('Unexpected script URL: ' + sourceURL); + } + originalParsedScriptSource.apply(this, arguments); + + if (!WebInspector.panels.scripts.visibleView) { + controller.reportFailure('No visible script view: ' + sourceURL); + return; + } + + if (parsedDebuggerTestJs && parsedDebuggerTestPageHtml) { + controller.reportOk(); + } + }; + + // Open Scripts panel. + var toolbar = document.getElementById('toolbar'); + var scriptsButton = toolbar.getElementsByClassName('scripts')[0]; + scriptsButton.click(); + + this.assertEquals(WebInspector.panels.scripts, WebInspector.currentPanel); + + // Wait until all scripts are added to the debugger. + controller.takeControl(); +}; + + var uiTests = new TestSuite(); |