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

Unified Diff: content/browser/cache_storage/cache_storage_manager_unittest.cc

Issue 2901083002: [CacheStorage] Pad and bin opaque resource sizes. (Closed)
Patch Set: Rebased and resolved conflicts. 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/cache_storage/cache_storage_manager_unittest.cc
diff --git a/content/browser/cache_storage/cache_storage_manager_unittest.cc b/content/browser/cache_storage/cache_storage_manager_unittest.cc
index 825fada5673fee7d66b1333f48f8c3d1b00832a1..89decab4fbda8856472783f6b2cec7a755448010 100644
--- a/content/browser/cache_storage/cache_storage_manager_unittest.cc
+++ b/content/browser/cache_storage/cache_storage_manager_unittest.cc
@@ -112,6 +112,8 @@ class CacheStorageManagerTest : public testing::Test {
virtual bool MemoryOnly() { return false; }
+ virtual bool PadResources() const { return false; }
+
void BoolCallback(base::RunLoop* run_loop, bool value) {
callback_bool_ = value;
run_loop->Quit();
@@ -504,10 +506,21 @@ class CacheStorageManagerMemoryOnlyTest : public CacheStorageManagerTest {
bool MemoryOnly() override { return true; }
};
+enum class CacheLocation { IN_MEMORY, ON_DISK };
+
+enum class PadType { ADD_PADDING, NO_PADDING };
+
class CacheStorageManagerTestP : public CacheStorageManagerTest,
- public testing::WithParamInterface<bool> {
+ public testing::WithParamInterface<
+ testing::tuple<CacheLocation, PadType>> {
public:
- bool MemoryOnly() override { return !GetParam(); }
+ bool MemoryOnly() override {
+ return testing::get<0>(GetParam()) == CacheLocation::IN_MEMORY;
+ }
+
+ bool PadResources() const override {
+ return testing::get<1>(GetParam()) == PadType::ADD_PADDING;
+ }
};
TEST_F(CacheStorageManagerTest, TestsRunOnIOThread) {
@@ -1408,9 +1421,17 @@ class CacheStorageQuotaClientDiskOnlyTest : public CacheStorageQuotaClientTest {
bool MemoryOnly() override { return false; }
};
-class CacheStorageQuotaClientTestP : public CacheStorageQuotaClientTest,
- public testing::WithParamInterface<bool> {
- bool MemoryOnly() override { return !GetParam(); }
+class CacheStorageQuotaClientTestP
+ : public CacheStorageQuotaClientTest,
+ public testing::WithParamInterface<
+ testing::tuple<CacheLocation, PadType>> {
+ bool MemoryOnly() override {
+ return testing::get<0>(GetParam()) == CacheLocation::IN_MEMORY;
+ }
+
+ bool PadResources() const override {
+ return testing::get<1>(GetParam()) == PadType::ADD_PADDING;
+ }
};
TEST_P(CacheStorageQuotaClientTestP, QuotaID) {
@@ -1500,12 +1521,18 @@ TEST_P(CacheStorageQuotaClientTestP, QuotaDoesSupport) {
EXPECT_FALSE(QuotaDoesSupport(storage::kStorageTypeUnknown));
}
-INSTANTIATE_TEST_CASE_P(CacheStorageManagerTests,
- CacheStorageManagerTestP,
- ::testing::Values(false, true));
+INSTANTIATE_TEST_CASE_P(
+ CacheStorageManagerTests,
+ CacheStorageManagerTestP,
+ ::testing::Combine(
+ ::testing::Values(CacheLocation::IN_MEMORY, CacheLocation::ON_DISK),
+ ::testing::Values(PadType::ADD_PADDING, PadType::NO_PADDING)));
-INSTANTIATE_TEST_CASE_P(CacheStorageQuotaClientTests,
- CacheStorageQuotaClientTestP,
- ::testing::Values(false, true));
+INSTANTIATE_TEST_CASE_P(
+ CacheStorageQuotaClientTests,
+ CacheStorageQuotaClientTestP,
+ ::testing::Combine(
+ ::testing::Values(CacheLocation::IN_MEMORY, CacheLocation::ON_DISK),
+ ::testing::Values(PadType::ADD_PADDING, PadType::NO_PADDING)));
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698