summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_update_job_unittest.cc
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-02 21:15:22 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-02 21:15:22 +0000
commitc8af9bba42a3f9275220c65b4aef626d2387140c (patch)
treebcc32419fda9d7dd5c85d02b5e85dc5477368094 /webkit/appcache/appcache_update_job_unittest.cc
parent3f8a1587775698f8e6fb9a210c27fdb643b93146 (diff)
downloadchromium_src-c8af9bba42a3f9275220c65b4aef626d2387140c.zip
chromium_src-c8af9bba42a3f9275220c65b4aef626d2387140c.tar.gz
chromium_src-c8af9bba42a3f9275220c65b4aef626d2387140c.tar.bz2
Quick fix to avoid crashing in unit tests when HTTPTestServer::CreateServer returns NULL.
BUG=45664 TEST=none Review URL: http://codereview.chromium.org/2501002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_update_job_unittest.cc')
-rw-r--r--webkit/appcache/appcache_update_job_unittest.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/webkit/appcache/appcache_update_job_unittest.cc b/webkit/appcache/appcache_update_job_unittest.cc
index 09c349d..7ea664f 100644
--- a/webkit/appcache/appcache_update_job_unittest.cc
+++ b/webkit/appcache/appcache_update_job_unittest.cc
@@ -373,10 +373,14 @@ class AppCacheUpdateJobTest : public testing::Test,
// Cleanup function; must be called on the IO Thread.
static void CleanupIOThread() {
- http_server_->Release();
- http_server_ = NULL;
- request_context_->Release();
- request_context_ = NULL;
+ if (http_server_) {
+ http_server_->Release();
+ http_server_ = NULL;
+ }
+ if (request_context_) {
+ request_context_->Release();
+ request_context_ = NULL;
+ }
io_thread_shutdown_event_->Signal();
}
@@ -394,6 +398,10 @@ class AppCacheUpdateJobTest : public testing::Test,
// when it goes out of scope.
template <class Method>
void RunTestOnIOThread(Method method) {
+ EXPECT_TRUE(http_server_);
+ if (!http_server_)
+ return; // Don't even try to run any of these tests w/o the server.
+
event_.reset(new base::WaitableEvent(false, false));
io_thread_->message_loop()->PostTask(
FROM_HERE, NewRunnableMethod(this, method));
@@ -3038,14 +3046,7 @@ TEST_F(AppCacheUpdateJobTest, ManifestRedirect) {
RunTestOnIOThread(&AppCacheUpdateJobTest::ManifestRedirectTest);
}
-#if defined(OS_MACOSX)
-// Crashing on mac webkit bots. http://crbug.com/45664
-#define MAYBE_ManifestWrongMimeType DISABLED_ManifestWrongMimeType
-#else
-#define MAYBE_ManifestWrongMimeType ManifestWrongMimeType
-#endif
-
-TEST_F(AppCacheUpdateJobTest, MAYBE_ManifestWrongMimeType) {
+TEST_F(AppCacheUpdateJobTest, ManifestWrongMimeType) {
RunTestOnIOThread(&AppCacheUpdateJobTest::ManifestWrongMimeTypeTest);
}