diff options
author | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-21 07:17:17 +0000 |
---|---|---|
committer | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-21 07:17:17 +0000 |
commit | 2c7b4d74870fe18ea04dcb281e43c4982c57f414 (patch) | |
tree | 75ce568f38bea39b676626939403982675985988 /webkit | |
parent | 28cf9883c15d5322b8becbdbd400e66774477201 (diff) | |
download | chromium_src-2c7b4d74870fe18ea04dcb281e43c4982c57f414.zip chromium_src-2c7b4d74870fe18ea04dcb281e43c4982c57f414.tar.gz chromium_src-2c7b4d74870fe18ea04dcb281e43c4982c57f414.tar.bz2 |
DevTools: test that content scripts are visible in the debugger scripts list
BUG=25294,24214
TEST=DevToolsExtensionDebugTest.TestContentScriptIsPresent
Review URL: http://codereview.chromium.org/295020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/devtools/js/tests.js | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/webkit/glue/devtools/js/tests.js b/webkit/glue/devtools/js/tests.js index 4253078..5c44afb 100644 --- a/webkit/glue/devtools/js/tests.js +++ b/webkit/glue/devtools/js/tests.js @@ -394,6 +394,24 @@ TestSuite.prototype.testShowScriptsTab = function() { /** + * Tests that scripts list contains content scripts. + */ +TestSuite.prototype.testContentScriptIsPresent = function() { + this.showPanel('scripts'); + var test = this; + + test._waitUntilScriptsAreParsed( + ['page_with_content_script.html$', 'simple_content_script.js$'], + function() { + test.releaseControl(); + }); + + // Wait until all scripts are added to the debugger. + this.takeControl(); +}; + + +/** * Tests that scripts are not duplicaed on Scripts tab switch. */ TestSuite.prototype.testNoScriptDuplicatesOnPanelSwitch = function() { @@ -920,14 +938,6 @@ TestSuite.prototype._executeCodeWhenScriptsAreParsed = function( code, expectedScripts) { var test = this; - function waitForAllScripts() { - if (test._scriptsAreParsed(expectedScripts)) { - executeFunctionInInspectedPage(); - } else { - test.addSniffer(WebInspector, 'parsedScriptSource', waitForAllScripts); - } - } - function executeFunctionInInspectedPage() { // Since breakpoints are ignored in evals' calculate() function is // execute after zero-timeout so that the breakpoint is hit. @@ -939,6 +949,26 @@ TestSuite.prototype._executeCodeWhenScriptsAreParsed = function( }); } + test._waitUntilScriptsAreParsed( + expectedScripts, executeFunctionInInspectedPage); +}; + + +/** + * Waits until all the scripts are parsed and invokes the callback. + */ +TestSuite.prototype._waitUntilScriptsAreParsed = function( + expectedScripts, callback) { + var test = this; + + function waitForAllScripts() { + if (test._scriptsAreParsed(expectedScripts)) { + callback(); + } else { + test.addSniffer(WebInspector, 'parsedScriptSource', waitForAllScripts); + } + } + waitForAllScripts(); }; |