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

Side by Side Diff: services/service_manager/tests/lifecycle/lifecycle_unittest.cc

Issue 2440903002: Make "all user" services work when packaged. (Closed)
Patch Set: Addressed latest comments and synced. Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 void OnServiceStarted(const service_manager::Identity& identity, 84 void OnServiceStarted(const service_manager::Identity& identity,
85 uint32_t pid) override { 85 uint32_t pid) override {
86 for (auto& instance : instances_) { 86 for (auto& instance : instances_) {
87 if (instance.second.identity == identity) { 87 if (instance.second.identity == identity) {
88 instance.second.pid = pid; 88 instance.second.pid = pid;
89 break; 89 break;
90 } 90 }
91 } 91 }
92 } 92 }
93 void OnServiceFailedToStart(
94 const service_manager::Identity& identity) override {
95 }
93 void OnServiceStopped(const service_manager::Identity& identity) override { 96 void OnServiceStopped(const service_manager::Identity& identity) override {
94 for (auto it = instances_.begin(); it != instances_.end(); ++it) { 97 for (auto it = instances_.begin(); it != instances_.end(); ++it) {
95 if (it->second.identity == identity) { 98 if (it->second.identity == identity) {
96 instances_.erase(it); 99 instances_.erase(it);
97 break; 100 break;
98 } 101 }
99 } 102 }
100 TryToQuitDestructionLoop(); 103 TryToQuitDestructionLoop();
101 } 104 }
102 105
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 parent->Quit(); 447 parent->Quit();
445 448
446 // Quitting the parent should cascade-quit the child. 449 // Quitting the parent should cascade-quit the child.
447 WaitForInstanceDestruction(); 450 WaitForInstanceDestruction();
448 EXPECT_EQ(0u, instances()->GetNewInstanceCount()); 451 EXPECT_EQ(0u, instances()->GetNewInstanceCount());
449 EXPECT_FALSE(instances()->HasInstanceForName(kTestParentName)); 452 EXPECT_FALSE(instances()->HasInstanceForName(kTestParentName));
450 EXPECT_FALSE(instances()->HasInstanceForName(kTestAppName)); 453 EXPECT_FALSE(instances()->HasInstanceForName(kTestAppName));
451 } 454 }
452 455
453 } // namespace service_manager 456 } // namespace service_manager
OLDNEW
« no previous file with comments | « services/service_manager/tests/connect/connect_unittest.cc ('k') | services/service_manager/tests/service_manager/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698