Chromium Code Reviews| Index: webkit/glue/devtools/js/tests.js |
| diff --git a/webkit/glue/devtools/js/tests.js b/webkit/glue/devtools/js/tests.js |
| index db3c8b2bdd6248c2b302a1b81e5af18b63e65264..55a46e16931e105e466176fc903ca540dd27fa1c 100644 |
| --- a/webkit/glue/devtools/js/tests.js |
| +++ b/webkit/glue/devtools/js/tests.js |
| @@ -363,6 +363,44 @@ TestSuite.prototype.testResourceHeaders = function() { |
| /** |
| + * Tests the mime type of a cached (HTTP 304) resource. |
| + */ |
| +TestSuite.prototype.testCachedResourceMimeType = function() { |
| + this.showPanel('resources'); |
| + |
| + var test = this; |
| + var hasReloaded = false; |
| + |
| + 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
|
| + function(identifier, payload) { |
| + var resource = this.resources[identifier]; |
| + if (resource.mainResource) { |
| + // We are only interested in secondary resources in this test. |
| + return; |
| + } |
| + |
| + if (payload.didResponseChange) { |
| + // Test server uses a default mime type for JavaScript files. |
| + 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
|
| + if (!hasReloaded) { |
| + hasReloaded = true; |
| + // Reload inspected page to update all resources. |
| + test.evaluateInConsole_( |
| + 'window.location.reload(true);', |
| + function() {}); |
| + } else { |
| + test.releaseControl(); |
| + } |
| + } |
| + |
| + }, true); |
| + |
| + WebInspector.panels.resources._enableResourceTracking(); |
| + this.takeControl(); |
| +}; |
| + |
| + |
| +/** |
| * Tests that profiler works. |
| */ |
| TestSuite.prototype.testProfilerTab = function() { |