OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include <stack> | 5 #include <stack> |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/thread.h" | 8 #include "base/thread.h" |
9 #include "base/waitable_event.h" | 9 #include "base/waitable_event.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 void RunTestOnIOThread(Method method) { | 220 void RunTestOnIOThread(Method method) { |
221 test_finished_event_ .reset(new base::WaitableEvent(false, false)); | 221 test_finished_event_ .reset(new base::WaitableEvent(false, false)); |
222 io_thread->message_loop()->PostTask( | 222 io_thread->message_loop()->PostTask( |
223 FROM_HERE, new WrapperTask<Method>(this, method)); | 223 FROM_HERE, new WrapperTask<Method>(this, method)); |
224 test_finished_event_->Wait(); | 224 test_finished_event_->Wait(); |
225 } | 225 } |
226 | 226 |
227 void SetUpTest() { | 227 void SetUpTest() { |
228 DCHECK(MessageLoop::current() == io_thread->message_loop()); | 228 DCHECK(MessageLoop::current() == io_thread->message_loop()); |
229 service_.reset(new AppCacheService); | 229 service_.reset(new AppCacheService); |
230 service_->Initialize(FilePath()); | 230 service_->Initialize(FilePath(), NULL); |
231 delegate_.reset(new MockStorageDelegate(this)); | 231 delegate_.reset(new MockStorageDelegate(this)); |
232 } | 232 } |
233 | 233 |
234 void TearDownTest() { | 234 void TearDownTest() { |
235 DCHECK(MessageLoop::current() == io_thread->message_loop()); | 235 DCHECK(MessageLoop::current() == io_thread->message_loop()); |
236 storage()->CancelDelegateCallbacks(delegate()); | 236 storage()->CancelDelegateCallbacks(delegate()); |
237 group_ = NULL; | 237 group_ = NULL; |
238 cache_ = NULL; | 238 cache_ = NULL; |
239 cache2_ = NULL; | 239 cache2_ = NULL; |
240 delegate_.reset(); | 240 delegate_.reset(); |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 | 1059 |
1060 } // namespace appcache | 1060 } // namespace appcache |
1061 | 1061 |
1062 // AppCacheStorageImplTest is expected to always live longer than the | 1062 // AppCacheStorageImplTest is expected to always live longer than the |
1063 // runnable methods. This lets us call NewRunnableMethod on its instances. | 1063 // runnable methods. This lets us call NewRunnableMethod on its instances. |
1064 template<> | 1064 template<> |
1065 struct RunnableMethodTraits<appcache::AppCacheStorageImplTest> { | 1065 struct RunnableMethodTraits<appcache::AppCacheStorageImplTest> { |
1066 void RetainCallee(appcache::AppCacheStorageImplTest* obj) { } | 1066 void RetainCallee(appcache::AppCacheStorageImplTest* obj) { } |
1067 void ReleaseCallee(appcache::AppCacheStorageImplTest* obj) { } | 1067 void ReleaseCallee(appcache::AppCacheStorageImplTest* obj) { } |
1068 }; | 1068 }; |
OLD | NEW |