Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 356 test.releaseControl(); | 356 test.releaseControl(); |
| 357 } | 357 } |
| 358 }, true); | 358 }, true); |
| 359 | 359 |
| 360 WebInspector.panels.resources._enableResourceTracking(); | 360 WebInspector.panels.resources._enableResourceTracking(); |
| 361 this.takeControl(); | 361 this.takeControl(); |
| 362 }; | 362 }; |
| 363 | 363 |
| 364 | 364 |
| 365 /** | 365 /** |
| 366 * Tests the mime type of a cached (HTTP 304) resource. | |
| 367 */ | |
| 368 TestSuite.prototype.testCachedResourceMimeType = function() { | |
| 369 this.showPanel('resources'); | |
| 370 | |
| 371 var test = this; | |
| 372 var hasReloaded = false; | |
| 373 | |
| 374 this.addSniffer(WebInspector, 'updateResource', | |
|
yurys
2009/11/26 12:56:22
are you sure WebInspector.updateResponse cannot ha
apavlov
2009/11/26 13:01:45
The test logic is a replica of the TestSuite.proto
| |
| 375 function(identifier, payload) { | |
| 376 var resource = this.resources[identifier]; | |
| 377 if (resource.mainResource) { | |
| 378 // We are only interested in secondary resources in this test. | |
| 379 return; | |
| 380 } | |
| 381 | |
| 382 if (payload.didResponseChange) { | |
| 383 // Test server uses a default mime type for JavaScript files. | |
| 384 test.assertEquals('text/html', payload.mimeType); | |
|
yurys
2009/11/26 12:56:22
is it possible to fix mime type for .js files? if
apavlov
2009/11/26 13:01:45
I'm somewhat reluctant to fix the server in the sa
| |
| 385 if (!hasReloaded) { | |
| 386 hasReloaded = true; | |
| 387 // Reload inspected page to update all resources. | |
| 388 test.evaluateInConsole_( | |
| 389 'window.location.reload(true);', | |
| 390 function() {}); | |
| 391 } else { | |
| 392 test.releaseControl(); | |
| 393 } | |
| 394 } | |
| 395 | |
| 396 }, true); | |
| 397 | |
| 398 WebInspector.panels.resources._enableResourceTracking(); | |
| 399 this.takeControl(); | |
| 400 }; | |
| 401 | |
| 402 | |
| 403 /** | |
| 366 * Tests that profiler works. | 404 * Tests that profiler works. |
| 367 */ | 405 */ |
| 368 TestSuite.prototype.testProfilerTab = function() { | 406 TestSuite.prototype.testProfilerTab = function() { |
| 369 this.showPanel('profiles'); | 407 this.showPanel('profiles'); |
| 370 | 408 |
| 371 var test = this; | 409 var test = this; |
| 372 this.addSniffer(WebInspector.panels.profiles, 'addProfileHeader', | 410 this.addSniffer(WebInspector.panels.profiles, 'addProfileHeader', |
| 373 function(typeOrProfile, profile) { | 411 function(typeOrProfile, profile) { |
| 374 if (!profile) { | 412 if (!profile) { |
| 375 profile = typeOrProfile; | 413 profile = typeOrProfile; |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1868 /** | 1906 /** |
| 1869 * Run specified test on a fresh instance of the test suite. | 1907 * Run specified test on a fresh instance of the test suite. |
| 1870 * @param {string} name Name of a test method from TestSuite class. | 1908 * @param {string} name Name of a test method from TestSuite class. |
| 1871 */ | 1909 */ |
| 1872 uiTests.runTest = function(name) { | 1910 uiTests.runTest = function(name) { |
| 1873 new TestSuite().runTest(name); | 1911 new TestSuite().runTest(name); |
| 1874 }; | 1912 }; |
| 1875 | 1913 |
| 1876 | 1914 |
| 1877 } | 1915 } |
| OLD | NEW |