Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1350)

Side by Side Diff: webkit/appcache/appcache_storage_impl_unittest.cc

Issue 2249005: AppCache: Use a dedicated thread for the disk cache. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Bound to IO thread Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/appcache/appcache_storage_impl.cc ('k') | webkit/appcache/appcache_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 };
OLDNEW
« no previous file with comments | « webkit/appcache/appcache_storage_impl.cc ('k') | webkit/appcache/appcache_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698