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

Side by Side Diff: content/browser/gpu/shader_disk_cache_unittest.cc

Issue 678073006: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bogus formatting Created 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/thread.h" 6 #include "base/threading/thread.h"
7 #include "content/browser/browser_thread_impl.h" 7 #include "content/browser/browser_thread_impl.h"
8 #include "content/browser/gpu/shader_disk_cache.h" 8 #include "content/browser/gpu/shader_disk_cache.h"
9 #include "content/public/test/test_browser_thread_bundle.h" 9 #include "content/public/test/test_browser_thread_bundle.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace content { 13 namespace content {
14 namespace { 14 namespace {
15 15
16 const int kDefaultClientId = 42; 16 const int kDefaultClientId = 42;
17 const char kCacheKey[] = "key"; 17 const char kCacheKey[] = "key";
18 const char kCacheValue[] = "cached value"; 18 const char kCacheValue[] = "cached value";
19 19
20 } // namespace 20 } // namespace
21 21
22 class ShaderDiskCacheTest : public testing::Test { 22 class ShaderDiskCacheTest : public testing::Test {
23 public: 23 public:
24 ShaderDiskCacheTest() 24 ShaderDiskCacheTest()
25 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) { 25 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {
26 } 26 }
27 27
28 virtual ~ShaderDiskCacheTest() {} 28 ~ShaderDiskCacheTest() override {}
29 29
30 const base::FilePath& cache_path() { return temp_dir_.path(); } 30 const base::FilePath& cache_path() { return temp_dir_.path(); }
31 31
32 void InitCache() { 32 void InitCache() {
33 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 33 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
34 ShaderCacheFactory::GetInstance()->SetCacheInfo(kDefaultClientId, 34 ShaderCacheFactory::GetInstance()->SetCacheInfo(kDefaultClientId,
35 cache_path()); 35 cache_path());
36 } 36 }
37 37
38 private: 38 private:
39 virtual void TearDown() override { 39 void TearDown() override {
40 ShaderCacheFactory::GetInstance()->RemoveCacheInfo(kDefaultClientId); 40 ShaderCacheFactory::GetInstance()->RemoveCacheInfo(kDefaultClientId);
41 } 41 }
42 42
43 base::ScopedTempDir temp_dir_; 43 base::ScopedTempDir temp_dir_;
44 content::TestBrowserThreadBundle thread_bundle_; 44 content::TestBrowserThreadBundle thread_bundle_;
45 45
46 DISALLOW_COPY_AND_ASSIGN(ShaderDiskCacheTest); 46 DISALLOW_COPY_AND_ASSIGN(ShaderDiskCacheTest);
47 }; 47 };
48 48
49 TEST_F(ShaderDiskCacheTest, ClearsCache) { 49 TEST_F(ShaderDiskCacheTest, ClearsCache) {
(...skipping 16 matching lines...) Expand all
66 EXPECT_EQ(1, cache->Size()); 66 EXPECT_EQ(1, cache->Size());
67 67
68 base::Time time; 68 base::Time time;
69 net::TestCompletionCallback clear_cb; 69 net::TestCompletionCallback clear_cb;
70 rv = cache->Clear(time, time, clear_cb.callback()); 70 rv = cache->Clear(time, time, clear_cb.callback());
71 ASSERT_EQ(net::OK, clear_cb.GetResult(rv)); 71 ASSERT_EQ(net::OK, clear_cb.GetResult(rv));
72 EXPECT_EQ(0, cache->Size()); 72 EXPECT_EQ(0, cache->Size());
73 }; 73 };
74 74
75 } // namespace content 75 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698