From 3a99f5984b6e2010377866f2f4221a4d3f52c374 Mon Sep 17 00:00:00 2001 From: nhiroki Date: Tue, 12 May 2015 06:28:23 -0700 Subject: [PATCH] CacheStorage: Remove duplicate member from CacheStorageManagerTest for cleanup This is a follow-up patch for merging CacheStorageError and ErrorType: https://codereview.chromium.org/1132683003 BUG=425505 TEST=n/a Review URL: https://codereview.chromium.org/1138013002 Cr-Commit-Position: refs/heads/master@{#329398} --- .../cache_storage_manager_unittest.cc | 29 ++++++++-------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/content/browser/cache_storage/cache_storage_manager_unittest.cc b/content/browser/cache_storage/cache_storage_manager_unittest.cc index 9f6843f227ab..4fb7e7fb4a81 100644 --- a/content/browser/cache_storage/cache_storage_manager_unittest.cc +++ b/content/browser/cache_storage/cache_storage_manager_unittest.cc @@ -29,7 +29,6 @@ class CacheStorageManagerTest : public testing::Test { : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), callback_bool_(false), callback_error_(CACHE_STORAGE_OK), - callback_cache_error_(CACHE_STORAGE_OK), origin1_("http://example1.com"), origin2_("http://example2.com") {} @@ -91,7 +90,7 @@ class CacheStorageManagerTest : public testing::Test { } void CachePutCallback(base::RunLoop* run_loop, CacheStorageError error) { - callback_cache_error_ = error; + callback_error_ = error; run_loop->Quit(); } @@ -100,7 +99,7 @@ class CacheStorageManagerTest : public testing::Test { CacheStorageError error, scoped_ptr response, scoped_ptr blob_data_handle) { - callback_cache_error_ = error; + callback_error_ = error; callback_cache_response_ = response.Pass(); // Deliberately drop the data handle as only the url is being tested. run_loop->Quit(); @@ -152,8 +151,7 @@ class CacheStorageManagerTest : public testing::Test { base::Unretained(this), base::Unretained(loop.get()))); loop->Run(); - bool error = callback_error_ != CACHE_STORAGE_OK; - return !error; + return callback_error_ == CACHE_STORAGE_OK; } bool StorageMatch(const GURL& origin, @@ -169,8 +167,7 @@ class CacheStorageManagerTest : public testing::Test { base::Unretained(this), base::Unretained(loop.get()))); loop->Run(); - bool error = callback_cache_error_ != CACHE_STORAGE_OK; - return !error; + return callback_error_ == CACHE_STORAGE_OK; } bool StorageMatchAll(const GURL& origin, const GURL& url) { @@ -184,8 +181,7 @@ class CacheStorageManagerTest : public testing::Test { base::Unretained(this), base::Unretained(loop.get()))); loop->Run(); - bool error = callback_cache_error_ != CACHE_STORAGE_OK; - return !error; + return callback_error_ == CACHE_STORAGE_OK; } bool CachePut(const scoped_refptr& cache, @@ -207,8 +203,7 @@ class CacheStorageManagerTest : public testing::Test { base::Unretained(this), base::Unretained(loop.get()))); loop->Run(); - bool error = callback_cache_error_ != CACHE_STORAGE_OK; - return !error; + return callback_error_ == CACHE_STORAGE_OK; } bool CacheMatch(const scoped_refptr& cache, @@ -223,8 +218,7 @@ class CacheStorageManagerTest : public testing::Test { base::Unretained(this), base::Unretained(loop.get()))); loop->Run(); - bool error = callback_cache_error_ != CACHE_STORAGE_OK; - return !error; + return callback_error_ == CACHE_STORAGE_OK; } CacheStorage* CacheStorageForOrigin(const GURL& origin) { @@ -242,7 +236,6 @@ class CacheStorageManagerTest : public testing::Test { scoped_refptr callback_cache_; int callback_bool_; CacheStorageError callback_error_; - CacheStorageError callback_cache_error_; scoped_ptr callback_cache_response_; std::vector callback_strings_; @@ -359,14 +352,14 @@ TEST_P(CacheStorageManagerTestP, StorageMatchNoEntry) { EXPECT_TRUE(Open(origin1_, "foo")); EXPECT_TRUE(CachePut(callback_cache_, GURL("http://example.com/foo"))); EXPECT_FALSE(StorageMatch(origin1_, "foo", GURL("http://example.com/bar"))); - EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_cache_error_); + EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_error_); } TEST_P(CacheStorageManagerTestP, StorageMatchNoCache) { EXPECT_TRUE(Open(origin1_, "foo")); EXPECT_TRUE(CachePut(callback_cache_, GURL("http://example.com/foo"))); EXPECT_FALSE(StorageMatch(origin1_, "bar", GURL("http://example.com/foo"))); - EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_cache_error_); + EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_error_); } TEST_P(CacheStorageManagerTestP, StorageMatchAllEntryExists) { @@ -379,12 +372,12 @@ TEST_P(CacheStorageManagerTestP, StorageMatchAllNoEntry) { EXPECT_TRUE(Open(origin1_, "foo")); EXPECT_TRUE(CachePut(callback_cache_, GURL("http://example.com/foo"))); EXPECT_FALSE(StorageMatchAll(origin1_, GURL("http://example.com/bar"))); - EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_cache_error_); + EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_error_); } TEST_P(CacheStorageManagerTestP, StorageMatchAllNoCaches) { EXPECT_FALSE(StorageMatchAll(origin1_, GURL("http://example.com/foo"))); - EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_cache_error_); + EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_error_); } TEST_P(CacheStorageManagerTestP, StorageMatchAllEntryExistsTwice) { -- 2.11.4.GIT