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

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

Issue 1132683003: CacheStorage: Merge CacheStorage::CacheStorageError and CacheStorageCache::ErrorType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix more Created 5 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 5c402513f087ba04c9bdb2571512429994a4bb8a..f0dfe4ad43cb0d237acd24659604421813771184 100644
--- a/content/browser/cache_storage/cache_storage_manager_unittest.cc
+++ b/content/browser/cache_storage/cache_storage_manager_unittest.cc
@@ -28,8 +28,8 @@ class CacheStorageManagerTest : public testing::Test {
CacheStorageManagerTest()
: browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP),
callback_bool_(false),
- callback_error_(CacheStorage::CACHE_STORAGE_ERROR_NO_ERROR),
- callback_cache_error_(CacheStorageCache::ERROR_TYPE_OK),
+ callback_error_(CACHE_STORAGE_OK),
+ callback_cache_error_(CACHE_STORAGE_OK),
origin1_("http://example1.com"),
origin2_("http://example2.com") {}
@@ -68,7 +68,7 @@ class CacheStorageManagerTest : public testing::Test {
void BoolAndErrorCallback(base::RunLoop* run_loop,
bool value,
- CacheStorage::CacheStorageError error) {
+ CacheStorageError error) {
callback_bool_ = value;
callback_error_ = error;
run_loop->Quit();
@@ -76,7 +76,7 @@ class CacheStorageManagerTest : public testing::Test {
void CacheAndErrorCallback(base::RunLoop* run_loop,
const scoped_refptr<CacheStorageCache>& cache,
- CacheStorage::CacheStorageError error) {
+ CacheStorageError error) {
callback_cache_ = cache;
callback_error_ = error;
run_loop->Quit();
@@ -84,21 +84,20 @@ class CacheStorageManagerTest : public testing::Test {
void StringsAndErrorCallback(base::RunLoop* run_loop,
const std::vector<std::string>& strings,
- CacheStorage::CacheStorageError error) {
+ CacheStorageError error) {
callback_strings_ = strings;
callback_error_ = error;
run_loop->Quit();
}
- void CachePutCallback(base::RunLoop* run_loop,
- CacheStorageCache::ErrorType error) {
+ void CachePutCallback(base::RunLoop* run_loop, CacheStorageError error) {
callback_cache_error_ = error;
run_loop->Quit();
}
void CacheMatchCallback(
base::RunLoop* run_loop,
- CacheStorageCache::ErrorType error,
+ CacheStorageError error,
scoped_ptr<ServiceWorkerResponse> response,
scoped_ptr<storage::BlobDataHandle> blob_data_handle) {
callback_cache_error_ = error;
@@ -115,7 +114,7 @@ class CacheStorageManagerTest : public testing::Test {
base::Unretained(this), base::Unretained(loop.get())));
loop->Run();
- bool error = callback_error_ != CacheStorage::CACHE_STORAGE_ERROR_NO_ERROR;
+ bool error = callback_error_ != CACHE_STORAGE_OK;
if (error)
EXPECT_TRUE(!callback_cache_.get());
else
@@ -153,7 +152,7 @@ class CacheStorageManagerTest : public testing::Test {
base::Unretained(this), base::Unretained(loop.get())));
loop->Run();
- bool error = callback_error_ != CacheStorage::CACHE_STORAGE_ERROR_NO_ERROR;
+ bool error = callback_error_ != CACHE_STORAGE_OK;
return !error;
}
@@ -170,7 +169,7 @@ class CacheStorageManagerTest : public testing::Test {
base::Unretained(this), base::Unretained(loop.get())));
loop->Run();
- bool error = callback_cache_error_ != CacheStorageCache::ERROR_TYPE_OK;
+ bool error = callback_cache_error_ != CACHE_STORAGE_OK;
return !error;
}
@@ -185,7 +184,7 @@ class CacheStorageManagerTest : public testing::Test {
base::Unretained(this), base::Unretained(loop.get())));
loop->Run();
- bool error = callback_cache_error_ != CacheStorageCache::ERROR_TYPE_OK;
+ bool error = callback_cache_error_ != CACHE_STORAGE_OK;
return !error;
}
@@ -203,7 +202,7 @@ class CacheStorageManagerTest : public testing::Test {
base::Unretained(this), base::Unretained(loop.get())));
loop->Run();
- bool error = callback_cache_error_ != CacheStorageCache::ERROR_TYPE_OK;
+ bool error = callback_cache_error_ != CACHE_STORAGE_OK;
return !error;
}
@@ -219,7 +218,7 @@ class CacheStorageManagerTest : public testing::Test {
base::Unretained(this), base::Unretained(loop.get())));
loop->Run();
- bool error = callback_cache_error_ != CacheStorageCache::ERROR_TYPE_OK;
+ bool error = callback_cache_error_ != CACHE_STORAGE_OK;
return !error;
}
@@ -237,8 +236,8 @@ class CacheStorageManagerTest : public testing::Test {
scoped_refptr<CacheStorageCache> callback_cache_;
int callback_bool_;
- CacheStorage::CacheStorageError callback_error_;
- CacheStorageCache::ErrorType callback_cache_error_;
+ CacheStorageError callback_error_;
+ CacheStorageError callback_cache_error_;
scoped_ptr<ServiceWorkerResponse> callback_cache_response_;
std::vector<std::string> callback_strings_;
@@ -312,7 +311,7 @@ TEST_P(CacheStorageManagerTestP, DeleteTwice) {
EXPECT_TRUE(Open(origin1_, "foo"));
EXPECT_TRUE(Delete(origin1_, "foo"));
EXPECT_FALSE(Delete(origin1_, "foo"));
- EXPECT_EQ(CacheStorage::CACHE_STORAGE_ERROR_NOT_FOUND, callback_error_);
+ EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_error_);
}
TEST_P(CacheStorageManagerTestP, EmptyKeys) {
@@ -355,14 +354,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(CacheStorageCache::ERROR_TYPE_NOT_FOUND, callback_cache_error_);
+ EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_cache_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(CacheStorageCache::ERROR_TYPE_NOT_FOUND, callback_cache_error_);
+ EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_cache_error_);
}
TEST_P(CacheStorageManagerTestP, StorageMatchAllEntryExists) {
@@ -375,12 +374,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(CacheStorageCache::ERROR_TYPE_NOT_FOUND, callback_cache_error_);
+ EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_cache_error_);
}
TEST_P(CacheStorageManagerTestP, StorageMatchAllNoCaches) {
EXPECT_FALSE(StorageMatchAll(origin1_, GURL("http://example.com/foo")));
- EXPECT_EQ(CacheStorageCache::ERROR_TYPE_NOT_FOUND, callback_cache_error_);
+ EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_cache_error_);
}
TEST_P(CacheStorageManagerTestP, StorageMatchAllEntryExistsTwice) {
« no previous file with comments | « content/browser/cache_storage/cache_storage_dispatcher_host.cc ('k') | content/common/cache_storage/cache_storage_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698