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

Side by Side 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, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/devtools/debugger_test_page.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 /** 6 /**
7 * @fileoverview This file contains small testing framework along with the 7 * @fileoverview This file contains small testing framework along with the
8 * test suite for the frontend. These tests are a part of the continues build 8 * test suite for the frontend. These tests are a part of the continues build
9 * and are executed by the devtools_sanity_unittest.cc as a part of the 9 * and are executed by the devtools_sanity_unittest.cc as a part of the
10 * Interactive UI Test suite. 10 * Interactive UI Test suite.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 controller.reportFailure(); 232 controller.reportFailure();
233 }; 233 };
234 234
235 InspectorController.startProfiling(); 235 InspectorController.startProfiling();
236 window.setTimeout('InspectorController.stopProfiling();', 1000); 236 window.setTimeout('InspectorController.stopProfiling();', 1000);
237 controller.takeControl(); 237 controller.takeControl();
238 }; 238 };
239 239
240 240
241 /**
242 * Tests that scripts tab can be open and populated with inspected scripts.
243 */
244 TestSuite.prototype.testShowScriptsTab = function(controller) {
245 var parsedDebuggerTestPageHtml = false;
246 var parsedDebuggerTestJs = false;
247
248 // Intercept parsedScriptSource calls to check that all expected scripts are
249 // added to the debugger.
250 var self = this;
251 var originalParsedScriptSource = WebInspector.parsedScriptSource;
252 WebInspector.parsedScriptSource = function(sourceID, sourceURL, source,
253 startingLine) {
254 if (sourceURL.search(/debugger_test_page.html$/) != -1) {
255 if (parsedDebuggerTestPageHtml) {
256 controller.reportFailure('Unexpected parse event: ' + sourceURL);
257 return;
258 }
259 parsedDebuggerTestPageHtml = true;
260 } else if (sourceURL.search(/debugger_test.js$/) != -1) {
261 if (parsedDebuggerTestJs) {
262 controller.reportFailure('Unexpected parse event: ' + sourceURL);
263 return;
264 }
265 parsedDebuggerTestJs = true;
266 } else {
267 controller.reportFailure('Unexpected script URL: ' + sourceURL);
268 }
269 originalParsedScriptSource.apply(this, arguments);
270
271 if (!WebInspector.panels.scripts.visibleView) {
272 controller.reportFailure('No visible script view: ' + sourceURL);
273 return;
274 }
275
276 if (parsedDebuggerTestJs && parsedDebuggerTestPageHtml) {
277 controller.reportOk();
278 }
279 };
280
281 // Open Scripts panel.
282 var toolbar = document.getElementById('toolbar');
283 var scriptsButton = toolbar.getElementsByClassName('scripts')[0];
284 scriptsButton.click();
285
286 this.assertEquals(WebInspector.panels.scripts, WebInspector.currentPanel);
287
288 // Wait until all scripts are added to the debugger.
289 controller.takeControl();
290 };
291
292
241 var uiTests = new TestSuite(); 293 var uiTests = new TestSuite();
242 294
243 295
244 } 296 }
OLDNEW
« 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