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

Side by Side Diff: net/disk_cache/disk_cache_test_base.cc

Issue 2839663002: Instantiate ScopedTaskEnvironment in net unittests. (Closed)
Patch Set: self-review Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/disk_cache/disk_cache_test_base.h" 5 #include "net/disk_cache/disk_cache_test_base.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 13 matching lines...) Expand all
24 #include "net/disk_cache/simple/simple_index.h" 24 #include "net/disk_cache/simple/simple_index.h"
25 #include "net/test/gtest_util.h" 25 #include "net/test/gtest_util.h"
26 #include "testing/gmock/include/gmock/gmock.h" 26 #include "testing/gmock/include/gmock/gmock.h"
27 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
28 28
29 using net::test::IsOk; 29 using net::test::IsOk;
30 30
31 DiskCacheTest::DiskCacheTest() { 31 DiskCacheTest::DiskCacheTest() {
32 CHECK(temp_dir_.CreateUniqueTempDir()); 32 CHECK(temp_dir_.CreateUniqueTempDir());
33 cache_path_ = temp_dir_.GetPath(); 33 cache_path_ = temp_dir_.GetPath();
34 if (!base::MessageLoop::current())
35 message_loop_.reset(new base::MessageLoopForIO());
36 } 34 }
37 35
38 DiskCacheTest::~DiskCacheTest() { 36 DiskCacheTest::~DiskCacheTest() {
39 } 37 }
40 38
41 bool DiskCacheTest::CopyTestCache(const std::string& name) { 39 bool DiskCacheTest::CopyTestCache(const std::string& name) {
42 base::FilePath path; 40 base::FilePath path;
43 PathService::Get(base::DIR_SOURCE_ROOT, &path); 41 PathService::Get(base::DIR_SOURCE_ROOT, &path);
44 path = path.AppendASCII("net"); 42 path = path.AppendASCII("net");
45 path = path.AppendASCII("data"); 43 path = path.AppendASCII("data");
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 if (size_) 350 if (size_)
353 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); 351 EXPECT_TRUE(cache_impl_->SetMaxSize(size_));
354 if (new_eviction_) 352 if (new_eviction_)
355 cache_impl_->SetNewEviction(); 353 cache_impl_->SetNewEviction();
356 cache_impl_->SetType(type_); 354 cache_impl_->SetType(type_);
357 cache_impl_->SetFlags(flags); 355 cache_impl_->SetFlags(flags);
358 net::TestCompletionCallback cb; 356 net::TestCompletionCallback cb;
359 int rv = cache_impl_->Init(cb.callback()); 357 int rv = cache_impl_->Init(cb.callback());
360 ASSERT_THAT(cb.GetResult(rv), IsOk()); 358 ASSERT_THAT(cb.GetResult(rv), IsOk());
361 } 359 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698