| Index: webkit/glue/devtools/js/tests.js
|
| ===================================================================
|
| --- webkit/glue/devtools/js/tests.js (revision 29620)
|
| +++ webkit/glue/devtools/js/tests.js (working copy)
|
| @@ -394,6 +394,24 @@
|
|
|
|
|
| /**
|
| + * 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 @@
|
| 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 @@
|
| });
|
| }
|
|
|
| + 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();
|
| };
|
|
|
|
|