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

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

Issue 151076: DevTools: add Scripts panel sanity test (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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/debugger_test_page.html ('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 19483)
+++ webkit/glue/devtools/js/tests.js (working copy)
@@ -238,6 +238,58 @@
};
+/**
+ * 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();
« no previous file with comments | « chrome/test/data/devtools/debugger_test_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698