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

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

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« no previous file with comments | « net/cert_net/nss_ocsp_unittest.cc ('k') | net/disk_cache/blockfile/backend_impl.cc » ('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) 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 int rv = cache->Init(cb.callback()); 57 int rv = cache->Init(cb.callback());
58 if (cb.GetResult(rv) != net::OK) 58 if (cb.GetResult(rv) != net::OK)
59 return scoped_ptr<disk_cache::BackendImpl>(); 59 return scoped_ptr<disk_cache::BackendImpl>();
60 60
61 disk_cache::Entry* entry = NULL; 61 disk_cache::Entry* entry = NULL;
62 rv = cache->CreateEntry(kExistingEntryKey, &entry, cb.callback()); 62 rv = cache->CreateEntry(kExistingEntryKey, &entry, cb.callback());
63 if (cb.GetResult(rv) != net::OK) 63 if (cb.GetResult(rv) != net::OK)
64 return scoped_ptr<disk_cache::BackendImpl>(); 64 return scoped_ptr<disk_cache::BackendImpl>();
65 entry->Close(); 65 entry->Close();
66 66
67 return cache.Pass(); 67 return cache;
68 } 68 }
69 69
70 } // namespace 70 } // namespace
71 71
72 // Tests that can run with different types of caches. 72 // Tests that can run with different types of caches.
73 class DiskCacheBackendTest : public DiskCacheTestWithCache { 73 class DiskCacheBackendTest : public DiskCacheTestWithCache {
74 protected: 74 protected:
75 // Some utility methods: 75 // Some utility methods:
76 76
77 // Perform IO operations on the cache until there is pending IO. 77 // Perform IO operations on the cache until there is pending IO.
(...skipping 3538 matching lines...) Expand 10 before | Expand all | Expand 10 after
3616 // after closing. 3616 // after closing.
3617 // NOTE: IF THIS TEST IS FLAKY THEN IT IS FAILING. See https://crbug.com/416940 3617 // NOTE: IF THIS TEST IS FLAKY THEN IT IS FAILING. See https://crbug.com/416940
3618 TEST_F(DiskCacheBackendTest, SimpleCacheDeleteQuickly) { 3618 TEST_F(DiskCacheBackendTest, SimpleCacheDeleteQuickly) {
3619 SetSimpleCacheMode(); 3619 SetSimpleCacheMode();
3620 for (int i = 0; i < 100; ++i) { 3620 for (int i = 0; i < 100; ++i) {
3621 InitCache(); 3621 InitCache();
3622 cache_.reset(); 3622 cache_.reset();
3623 EXPECT_TRUE(CleanupCacheDir()); 3623 EXPECT_TRUE(CleanupCacheDir());
3624 } 3624 }
3625 } 3625 }
OLDNEW
« no previous file with comments | « net/cert_net/nss_ocsp_unittest.cc ('k') | net/disk_cache/blockfile/backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698