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

Side by Side Diff: content/browser/storage_partition_impl_unittest.cc

Issue 2472473002: gpu shader cache: Clarify lifetime/ownership/threadiness of objects. (Closed)
Patch Set: iwyu Created 4 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
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 scoped_refptr<MockQuotaManager> quota_manager_; 594 scoped_refptr<MockQuotaManager> quota_manager_;
595 595
596 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImplTest); 596 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImplTest);
597 }; 597 };
598 598
599 class StoragePartitionShaderClearTest : public testing::Test { 599 class StoragePartitionShaderClearTest : public testing::Test {
600 public: 600 public:
601 StoragePartitionShaderClearTest() 601 StoragePartitionShaderClearTest()
602 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), 602 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
603 browser_context_(new TestBrowserContext()) { 603 browser_context_(new TestBrowserContext()) {
604 ShaderCacheFactory::InitInstance(
605 base::ThreadTaskRunnerHandle::Get(),
606 BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE));
604 ShaderCacheFactory::GetInstance()->SetCacheInfo( 607 ShaderCacheFactory::GetInstance()->SetCacheInfo(
605 kDefaultClientId, 608 kDefaultClientId,
606 BrowserContext::GetDefaultStoragePartition( 609 BrowserContext::GetDefaultStoragePartition(
607 browser_context())->GetPath()); 610 browser_context())->GetPath());
608 cache_ = ShaderCacheFactory::GetInstance()->Get(kDefaultClientId); 611 cache_ = ShaderCacheFactory::GetInstance()->Get(kDefaultClientId);
609 } 612 }
610 613
611 ~StoragePartitionShaderClearTest() override { 614 ~StoragePartitionShaderClearTest() override {
612 cache_ = NULL; 615 cache_ = NULL;
613 ShaderCacheFactory::GetInstance()->RemoveCacheInfo(kDefaultClientId); 616 ShaderCacheFactory::GetInstance()->RemoveCacheInfo(kDefaultClientId);
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 CanonicalCookie::Create(url2, "A=B;domain=.example.com", now, options)); 1315 CanonicalCookie::Create(url2, "A=B;domain=.example.com", now, options));
1313 invalid_cookies.push_back(CanonicalCookie::Create(url3, "A=B", now, options)); 1316 invalid_cookies.push_back(CanonicalCookie::Create(url3, "A=B", now, options));
1314 1317
1315 for (const auto& cookie : valid_cookies) 1318 for (const auto& cookie : valid_cookies)
1316 EXPECT_TRUE(predicate.Run(*cookie)) << cookie->DebugString(); 1319 EXPECT_TRUE(predicate.Run(*cookie)) << cookie->DebugString();
1317 for (const auto& cookie : invalid_cookies) 1320 for (const auto& cookie : invalid_cookies)
1318 EXPECT_FALSE(predicate.Run(*cookie)) << cookie->DebugString(); 1321 EXPECT_FALSE(predicate.Run(*cookie)) << cookie->DebugString();
1319 } 1322 }
1320 1323
1321 } // namespace content 1324 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698