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

Unified Diff: chrome/browser/extensions/extension_special_storage_policy_unittest.cc

Issue 2592793002: Revert of Change how the quota system computes the total poolsize for temporary storage (Closed)
Patch Set: Created 4 years 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: chrome/browser/extensions/extension_special_storage_policy_unittest.cc
diff --git a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
index 1916e307c259080188c33a1c7abeca14df517d1d..b25b31f0e34246b36cb77c736903fe3a5d58f869 100644
--- a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
@@ -251,6 +251,23 @@ TEST_F(ExtensionSpecialStoragePolicyTest, AppWithUnlimitedStorage) {
EXPECT_FALSE(policy_->IsStorageUnlimited(GURL("https://bar.wildcards/")));
}
+TEST_F(ExtensionSpecialStoragePolicyTest, CanQueryDiskSize) {
+ const GURL kHttpUrl("http://foo");
+ const GURL kExtensionUrl("chrome-extension://bar");
+ scoped_refptr<Extension> regular_app(CreateRegularApp());
+ scoped_refptr<Extension> protected_app(CreateProtectedApp());
+ scoped_refptr<Extension> unlimited_app(CreateUnlimitedApp());
+ policy_->GrantRightsForExtension(regular_app.get(), NULL);
+ policy_->GrantRightsForExtension(protected_app.get(), NULL);
+ policy_->GrantRightsForExtension(unlimited_app.get(), NULL);
+
+ EXPECT_FALSE(policy_->CanQueryDiskSize(kHttpUrl));
+ EXPECT_FALSE(policy_->CanQueryDiskSize(kExtensionUrl));
+ EXPECT_TRUE(policy_->CanQueryDiskSize(regular_app->url()));
+ EXPECT_TRUE(policy_->CanQueryDiskSize(protected_app->url()));
+ EXPECT_TRUE(policy_->CanQueryDiskSize(unlimited_app->url()));
+}
+
TEST_F(ExtensionSpecialStoragePolicyTest, HasIsolatedStorage) {
const GURL kHttpUrl("http://foo");
const GURL kExtensionUrl("chrome-extension://bar");
« no previous file with comments | « chrome/browser/extensions/extension_special_storage_policy.cc ('k') | chrome/browser/extensions/extension_storage_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698