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

Unified Diff: content/browser/service_worker/service_worker_storage_unittest.cc

Issue 672813002: [ServiceWorker] Added size deltas and total size computation for QuotaM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing piping issue, and added check for size propagation Created 6 years, 2 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/service_worker/service_worker_storage_unittest.cc
diff --git a/content/browser/service_worker/service_worker_storage_unittest.cc b/content/browser/service_worker/service_worker_storage_unittest.cc
index cc65c34d03313f911b3d8c3d65059893adb82997..cbe0b59a2622d594b5777c1585e3f310899feeeb 100644
--- a/content/browser/service_worker/service_worker_storage_unittest.cc
+++ b/content/browser/service_worker/service_worker_storage_unittest.cc
@@ -465,6 +465,7 @@ TEST_F(ServiceWorkerStorageTest, InstallingRegistrationsAreFindable) {
const GURL kDocumentUrl("http://www.test.not/scope/document.html");
const int64 kRegistrationId = 0;
const int64 kVersionId = 0;
+ const int64 kWorkerSize = 12592;
scoped_refptr<ServiceWorkerRegistration> found_registration;
@@ -472,6 +473,7 @@ TEST_F(ServiceWorkerStorageTest, InstallingRegistrationsAreFindable) {
scoped_refptr<ServiceWorkerRegistration> live_registration =
new ServiceWorkerRegistration(
kScope, kRegistrationId, context_ptr_);
+ live_registration->set_resources_total_size_bytes(kWorkerSize);
scoped_refptr<ServiceWorkerVersion> live_version =
new ServiceWorkerVersion(
live_registration.get(), kScript, kVersionId, context_ptr_);
@@ -518,6 +520,8 @@ TEST_F(ServiceWorkerStorageTest, InstallingRegistrationsAreFindable) {
GetAllRegistrations(&all_registrations);
EXPECT_EQ(1u, all_registrations.size());
+ ServiceWorkerRegistrationInfo info = all_registrations[0];
+ EXPECT_EQ(kWorkerSize, info.stored_version_size_bytes);
michaeln 2014/10/31 23:10:58 This test hits the case where the ServiceWorkerReg
dmurph 2014/10/31 23:41:02 Done.
all_registrations.clear();
// Notify storage of installation no longer happening.
« no previous file with comments | « content/browser/service_worker/service_worker_storage.cc ('k') | content/public/browser/service_worker_usage_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698