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

Side by Side Diff: services/url_response_disk_cache/url_response_disk_cache_db_unittests.cc

Issue 1408793006: Convert "return local_var.Pass();" to "return local_var;". (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/files/scoped_temp_dir.h" 5 #include "base/files/scoped_temp_dir.h"
6 #include "base/threading/platform_thread.h" 6 #include "base/threading/platform_thread.h"
7 #include "services/url_response_disk_cache/url_response_disk_cache_db.h" 7 #include "services/url_response_disk_cache/url_response_disk_cache_db.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 11 matching lines...) Expand all
22 db_ = nullptr; 22 db_ = nullptr;
23 base::FilePath db_path = tmp_dir_.path().Append("db"); 23 base::FilePath db_path = tmp_dir_.path().Append("db");
24 db_ = new URLResponseDiskCacheDB(db_path); 24 db_ = new URLResponseDiskCacheDB(db_path);
25 } 25 }
26 26
27 CacheEntryPtr NewEntry() { 27 CacheEntryPtr NewEntry() {
28 CacheEntryPtr entry = CacheEntry::New(); 28 CacheEntryPtr entry = CacheEntry::New();
29 entry->response = URLResponse::New(); 29 entry->response = URLResponse::New();
30 entry->entry_directory = "/cache"; 30 entry->entry_directory = "/cache";
31 entry->response_body_path = "/cache/content"; 31 entry->response_body_path = "/cache/content";
32 return entry.Pass(); 32 return entry;
33 } 33 }
34 34
35 base::ScopedTempDir tmp_dir_; 35 base::ScopedTempDir tmp_dir_;
36 scoped_refptr<URLResponseDiskCacheDB> db_; 36 scoped_refptr<URLResponseDiskCacheDB> db_;
37 }; 37 };
38 38
39 TEST_F(URLResponseDiskCacheDBTest, Create) {} 39 TEST_F(URLResponseDiskCacheDBTest, Create) {}
40 40
41 TEST_F(URLResponseDiskCacheDBTest, Version) { 41 TEST_F(URLResponseDiskCacheDBTest, Version) {
42 EXPECT_EQ(0lu, db_->GetVersion()); 42 EXPECT_EQ(0lu, db_->GetVersion());
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 db_->PutNew(origin, url2, NewEntry()); 149 db_->PutNew(origin, url2, NewEntry());
150 150
151 EXPECT_TRUE(iterator->HasNext()); 151 EXPECT_TRUE(iterator->HasNext());
152 iterator->GetNext(nullptr, nullptr); 152 iterator->GetNext(nullptr, nullptr);
153 EXPECT_FALSE(iterator->HasNext()); 153 EXPECT_FALSE(iterator->HasNext());
154 } 154 }
155 155
156 } // namespace 156 } // namespace
157 157
158 } // namespace mojo 158 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698