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

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

Issue 2569963002: MemoryCoordinator checks if ServiceWorker exists on the suspending process (Closed)
Patch Set: Descriptive -> imperative 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: content/browser/service_worker/service_worker_process_manager_unittest.cc
diff --git a/content/browser/service_worker/service_worker_process_manager_unittest.cc b/content/browser/service_worker/service_worker_process_manager_unittest.cc
index 1367d3de2c6eb728a7dff0f60d3711b807922399..efc77ff2cb024369affbafe7157fd6ad29929e6d 100644
--- a/content/browser/service_worker/service_worker_process_manager_unittest.cc
+++ b/content/browser/service_worker/service_worker_process_manager_unittest.cc
@@ -138,8 +138,8 @@ TEST_P(ServiceWorkerProcessManagerTestP,
std::unique_ptr<MockRenderProcessHost> host2(CreateRenderProcessHost());
process_manager_->AddProcessReferenceToPattern(scope1, host1->GetID());
process_manager_->AddProcessReferenceToPattern(scope2, host2->GetID());
- ASSERT_EQ(0, host1->worker_ref_count());
- ASSERT_EQ(0, host2->worker_ref_count());
+ ASSERT_EQ(0u, host1->GetWorkerRefCount());
+ ASSERT_EQ(0u, host2->GetWorkerRefCount());
std::map<int, ServiceWorkerProcessManager::ProcessInfo>& instance_info =
process_manager_->instance_info_;
@@ -160,8 +160,8 @@ TEST_P(ServiceWorkerProcessManagerTestP,
EXPECT_EQ(SERVICE_WORKER_OK, status);
EXPECT_EQ(host1->GetID(), process_id);
EXPECT_FALSE(is_new_process);
- EXPECT_EQ(1, host1->worker_ref_count());
- EXPECT_EQ(0, host2->worker_ref_count());
+ EXPECT_EQ(1u, host1->GetWorkerRefCount());
+ EXPECT_EQ(0u, host2->GetWorkerRefCount());
EXPECT_EQ(1u, instance_info.size());
std::map<int, ServiceWorkerProcessManager::ProcessInfo>::iterator found =
instance_info.find(kEmbeddedWorkerId1);
@@ -185,8 +185,8 @@ TEST_P(ServiceWorkerProcessManagerTestP,
EXPECT_EQ(SERVICE_WORKER_OK, status);
EXPECT_EQ(host1->GetID(), process_id);
EXPECT_FALSE(is_new_process);
- EXPECT_EQ(2, host1->worker_ref_count());
- EXPECT_EQ(0, host2->worker_ref_count());
+ EXPECT_EQ(2u, host1->GetWorkerRefCount());
+ EXPECT_EQ(0u, host2->GetWorkerRefCount());
EXPECT_EQ(2u, instance_info.size());
found = instance_info.find(kEmbeddedWorkerId2);
ASSERT_TRUE(found != instance_info.end());
@@ -209,8 +209,8 @@ TEST_P(ServiceWorkerProcessManagerTestP,
EXPECT_EQ(SERVICE_WORKER_OK, status);
EXPECT_EQ(host2->GetID(), process_id);
EXPECT_FALSE(is_new_process);
- EXPECT_EQ(2, host1->worker_ref_count());
- EXPECT_EQ(1, host2->worker_ref_count());
+ EXPECT_EQ(2u, host1->GetWorkerRefCount());
+ EXPECT_EQ(1u, host2->GetWorkerRefCount());
EXPECT_EQ(3u, instance_info.size());
found = instance_info.find(kEmbeddedWorkerId3);
ASSERT_TRUE(found != instance_info.end());
@@ -218,21 +218,21 @@ TEST_P(ServiceWorkerProcessManagerTestP,
// The instance map should be updated by process release.
process_manager_->ReleaseWorkerProcess(kEmbeddedWorkerId3);
- EXPECT_EQ(2, host1->worker_ref_count());
- EXPECT_EQ(0, host2->worker_ref_count());
+ EXPECT_EQ(2u, host1->GetWorkerRefCount());
+ EXPECT_EQ(0u, host2->GetWorkerRefCount());
EXPECT_EQ(2u, instance_info.size());
EXPECT_TRUE(base::ContainsKey(instance_info, kEmbeddedWorkerId1));
EXPECT_TRUE(base::ContainsKey(instance_info, kEmbeddedWorkerId2));
process_manager_->ReleaseWorkerProcess(kEmbeddedWorkerId1);
- EXPECT_EQ(1, host1->worker_ref_count());
- EXPECT_EQ(0, host2->worker_ref_count());
+ EXPECT_EQ(1u, host1->GetWorkerRefCount());
+ EXPECT_EQ(0u, host2->GetWorkerRefCount());
EXPECT_EQ(1u, instance_info.size());
EXPECT_TRUE(base::ContainsKey(instance_info, kEmbeddedWorkerId2));
process_manager_->ReleaseWorkerProcess(kEmbeddedWorkerId2);
- EXPECT_EQ(0, host1->worker_ref_count());
- EXPECT_EQ(0, host2->worker_ref_count());
+ EXPECT_EQ(0u, host1->GetWorkerRefCount());
+ EXPECT_EQ(0u, host2->GetWorkerRefCount());
EXPECT_TRUE(instance_info.empty());
}
« no previous file with comments | « content/browser/service_worker/service_worker_browsertest.cc ('k') | content/public/browser/render_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698