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

Unified Diff: webkit/glue/devtools/js/tests.js

Issue 295020: DevTools: test that content scripts are visible in the debugger scripts list (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/devtools/extensions/simple_content_script/simple_content_script.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
};
« no previous file with comments | « chrome/test/data/devtools/extensions/simple_content_script/simple_content_script.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698