diff options
author | apavlov@chromium.org <apavlov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-26 13:11:48 +0000 |
---|---|---|
committer | apavlov@chromium.org <apavlov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-26 13:11:48 +0000 |
commit | bdc635e791b8fdc2e16faabc8ec09a2a3c36a760 (patch) | |
tree | 988845d1434089bebc1b9c914f4ccfc6de00961c | |
parent | 5e43ceb104132688449e3d59c0c92d9660c7bb57 (diff) | |
download | chromium_src-bdc635e791b8fdc2e16faabc8ec09a2a3c36a760.zip chromium_src-bdc635e791b8fdc2e16faabc8ec09a2a3c36a760.tar.gz chromium_src-bdc635e791b8fdc2e16faabc8ec09a2a3c36a760.tar.bz2 |
Remove Content-Type workaround for cached resources
BUG=27364
TEST=DevToolsSanityTest.TestCachedResourceMimeType
Review URL: http://codereview.chromium.org/437089
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33206 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/debugger/devtools_sanity_unittest.cc | 6 | ||||
-rw-r--r-- | webkit/glue/devtools/js/devtools.js | 17 | ||||
-rw-r--r-- | webkit/glue/devtools/js/tests.js | 38 |
3 files changed, 44 insertions, 17 deletions
diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc index 94ab316..69fca88 100644 --- a/chrome/browser/debugger/devtools_sanity_unittest.cc +++ b/chrome/browser/debugger/devtools_sanity_unittest.cc @@ -284,6 +284,12 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestResourceHeaders) { RunTest("testResourceHeaders", kResourceTestPage); } +// Tests cached resource mime type. +// @see http://crbug.com/27364 +IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestCachedResourceMimeType) { + RunTest("testCachedResourceMimeType", kResourceTestPage); +} + // Tests profiler panel. IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestProfilerTab) { RunTest("testProfilerTab", kJsPage); diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js index 75c3193..a6746ca 100644 --- a/webkit/glue/devtools/js/devtools.js +++ b/webkit/glue/devtools/js/devtools.js @@ -449,23 +449,6 @@ WebInspector.ConsoleMessage.prototype.setMessageBody = function(args) { }; })(); -// Temporary fix for http://crbug/23260. -(function() { -var orig = WebInspector.ResourcesPanel.prototype._createResourceView; -WebInspector.ResourcesPanel.prototype._createResourceView = function( - resource) { - if (resource.type == undefined && resource.url) { - if (resource.url.search('\.js$') != -1) { - resource.type = WebInspector.Resource.Type.Script; - } else if (resource.url.search('\.html$') != -1) { - resource.type = WebInspector.Resource.Type.Document; - } - } - - return orig.apply(this, arguments); -}; -})(); - (function() { var orig = InjectedScriptAccess.getCompletions; diff --git a/webkit/glue/devtools/js/tests.js b/webkit/glue/devtools/js/tests.js index db3c8b2..55a46e1 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', + 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); + 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() { |