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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc

Issue 7692016: Delete indexedDBs from the cookie tree ui. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_quota_client.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <map> 5 #include <map>
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/scoped_callback_factory.h" 9 #include "base/memory/scoped_callback_factory.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 void AddFakeIndexedDB(const GURL& origin, int size) { 116 void AddFakeIndexedDB(const GURL& origin, int size) {
117 FilePath file_path_origin = idb_context()->GetIndexedDBFilePath( 117 FilePath file_path_origin = idb_context()->GetIndexedDBFilePath(
118 DatabaseUtil::GetOriginIdentifier(origin)); 118 DatabaseUtil::GetOriginIdentifier(origin));
119 if (!file_util::CreateDirectory(file_path_origin)) { 119 if (!file_util::CreateDirectory(file_path_origin)) {
120 LOG(ERROR) << "failed to file_util::CreateDirectory " 120 LOG(ERROR) << "failed to file_util::CreateDirectory "
121 << file_path_origin.value(); 121 << file_path_origin.value();
122 } 122 }
123 file_path_origin = file_path_origin.Append(FILE_PATH_LITERAL("fake_file")); 123 file_path_origin = file_path_origin.Append(FILE_PATH_LITERAL("fake_file"));
124 SetFileSizeTo(file_path_origin, size); 124 SetFileSizeTo(file_path_origin, size);
125 idb_context()->ResetCaches();
125 } 126 }
126 127
127 private: 128 private:
128 void OnGetOriginUsageComplete(int64 usage) { 129 void OnGetOriginUsageComplete(int64 usage) {
129 usage_ = usage; 130 usage_ = usage;
130 } 131 }
131 132
132 void OnGetOriginsComplete(const std::set<GURL>& origins, 133 void OnGetOriginsComplete(const std::set<GURL>& origins,
133 quota::StorageType type) { 134 quota::StorageType type) {
134 origins_ = origins; 135 origins_ = origins;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 AddFakeIndexedDB(kOriginA, 1000); 222 AddFakeIndexedDB(kOriginA, 1000);
222 AddFakeIndexedDB(kOriginB, 50); 223 AddFakeIndexedDB(kOriginB, 50);
223 EXPECT_EQ(1000, GetOriginUsage(&client, kOriginA, kTemp)); 224 EXPECT_EQ(1000, GetOriginUsage(&client, kOriginA, kTemp));
224 EXPECT_EQ(50, GetOriginUsage(&client, kOriginB, kTemp)); 225 EXPECT_EQ(50, GetOriginUsage(&client, kOriginB, kTemp));
225 226
226 quota::QuotaStatusCode delete_status = DeleteOrigin(&client, kOriginA); 227 quota::QuotaStatusCode delete_status = DeleteOrigin(&client, kOriginA);
227 EXPECT_EQ(quota::kQuotaStatusOk, delete_status); 228 EXPECT_EQ(quota::kQuotaStatusOk, delete_status);
228 EXPECT_EQ(0, GetOriginUsage(&client, kOriginA, kTemp)); 229 EXPECT_EQ(0, GetOriginUsage(&client, kOriginA, kTemp));
229 EXPECT_EQ(50, GetOriginUsage(&client, kOriginB, kTemp)); 230 EXPECT_EQ(50, GetOriginUsage(&client, kOriginB, kTemp));
230 } 231 }
OLDNEW
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_quota_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698