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

Unified Diff: webkit/fileapi/file_system_context_unittest.cc

Issue 7633016: Test cleanup: Using MockSpecialStoragePolicy instead of local subclasses of SpecialStoragePolicy. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Keeping up to date with trunk. Created 9 years, 4 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: webkit/fileapi/file_system_context_unittest.cc
diff --git a/webkit/fileapi/file_system_context_unittest.cc b/webkit/fileapi/file_system_context_unittest.cc
index 2992dfb9006b05a7d2b7feb983329cd29870432f..19da15777426e790b81a322de97d263289afd8ef 100644
--- a/webkit/fileapi/file_system_context_unittest.cc
+++ b/webkit/fileapi/file_system_context_unittest.cc
@@ -12,6 +12,7 @@
#include "base/string_number_conversions.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/quota/mock_special_storage_policy.h"
#include "webkit/quota/quota_manager.h"
namespace fileapi {
@@ -24,21 +25,6 @@ static const char* const kTestOrigins[] = {
"file:///",
};
-class TestSpecialStoragePolicy : public quota::SpecialStoragePolicy {
- public:
- virtual bool IsStorageProtected(const GURL& origin) {
- return false;
- }
-
- virtual bool IsStorageUnlimited(const GURL& origin) {
- return origin == GURL(kTestOrigins[1]);
- }
-
- virtual bool IsFileHandler(const std::string& extension_id) {
- return false;
- }
-};
-
scoped_refptr<FileSystemContext> NewFileSystemContext(
bool allow_file_access,
bool unlimited_quota,
@@ -81,7 +67,10 @@ TEST(FileSystemContextTest, IsStorageUnlimited) {
}
// With SpecialStoragePolicy.
- scoped_refptr<TestSpecialStoragePolicy> policy(new TestSpecialStoragePolicy);
+ scoped_refptr<quota::MockSpecialStoragePolicy> policy(
+ new quota::MockSpecialStoragePolicy);
+ policy->AddUnlimited(GURL(kTestOrigins[1]));
+
context = NewFileSystemContext(false, false, policy);
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestOrigins); ++i) {
SCOPED_TRACE(testing::Message() << "IsStorageUnlimited /w policy #"
« no previous file with comments | « webkit/database/database_tracker_unittest.cc ('k') | webkit/fileapi/file_system_dir_url_request_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698