1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "dbus/test_service.h"
12 #include "base/functional/bind.h"
13 #include "base/functional/callback_helpers.h"
14 #include "base/logging.h"
15 #include "base/message_loop/message_pump_type.h"
16 #include "base/run_loop.h"
17 #include "base/task/single_thread_task_runner.h"
18 #include "base/test/test_timeouts.h"
19 #include "base/threading/platform_thread.h"
20 #include "base/time/time.h"
21 #include "base/uuid.h"
23 #include "dbus/exported_object.h"
24 #include "dbus/message.h"
25 #include "dbus/object_manager.h"
26 #include "dbus/object_path.h"
27 #include "dbus/property.h"
31 // Echo, SlowEcho, AsyncEcho, BrokenMethod, GetAll, Get, Set, PerformAction,
33 const int TestService::kNumMethodsToExport = 9;
35 TestService::Options::Options()
36 : request_ownership_options(Bus::REQUIRE_PRIMARY) {
39 TestService::Options::~Options() = default;
41 TestService::TestService(const Options& options)
42 : base::Thread("TestService"),
43 service_name_(options.service_name),
44 request_ownership_options_(options.request_ownership_options),
45 dbus_task_runner_(options.dbus_task_runner),
46 on_name_obtained_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
47 base::WaitableEvent::InitialState::NOT_SIGNALED),
48 num_exported_methods_(0),
49 send_immediate_properties_changed_(false),
50 has_ownership_(false),
51 exported_object_(nullptr),
52 exported_object_manager_(nullptr) {
53 if (service_name_.empty()) {
54 service_name_ = "org.chromium.TestService-" +
55 base::Uuid::GenerateRandomV4().AsLowercaseString();
59 TestService::~TestService() {
63 bool TestService::StartService() {
64 base::Thread::Options thread_options;
65 thread_options.message_pump_type = base::MessagePumpType::IO;
66 return StartWithOptions(std::move(thread_options));
69 void TestService::WaitUntilServiceIsStarted() {
70 // Wait until the ownership of the service name is obtained.
71 on_name_obtained_.Wait();
74 void TestService::ShutdownAndBlock() {
75 task_runner()->PostTask(FROM_HERE,
76 base::BindOnce(&TestService::ShutdownAndBlockInternal,
77 base::Unretained(this)));
80 bool TestService::HasDBusThread() {
81 return bus_->HasDBusThread();
84 void TestService::ShutdownAndBlockInternal() {
86 bus_->ShutdownOnDBusThreadAndBlock();
88 bus_->ShutdownAndBlock();
91 void TestService::SendTestSignal(const std::string& message) {
92 task_runner()->PostTask(FROM_HERE,
93 base::BindOnce(&TestService::SendTestSignalInternal,
94 base::Unretained(this), message));
97 void TestService::SendTestSignalFromRoot(const std::string& message) {
98 task_runner()->PostTask(
99 FROM_HERE, base::BindOnce(&TestService::SendTestSignalFromRootInternal,
100 base::Unretained(this), message));
103 void TestService::SendTestSignalInternal(const std::string& message) {
104 Signal signal("org.chromium.TestInterface", "Test");
105 MessageWriter writer(&signal);
106 writer.AppendString(message);
107 exported_object_->SendSignal(&signal);
110 void TestService::SendTestSignalFromRootInternal(const std::string& message) {
111 Signal signal("org.chromium.TestInterface", "Test");
112 MessageWriter writer(&signal);
113 writer.AppendString(message);
115 bus_->RequestOwnership(
116 service_name_, request_ownership_options_,
117 base::BindOnce(&TestService::OnOwnership, base::Unretained(this),
120 // Use "/" just like dbus-send does.
121 ExportedObject* root_object = bus_->GetExportedObject(ObjectPath("/"));
122 root_object->SendSignal(&signal);
125 void TestService::RequestOwnership(base::OnceCallback<void(bool)> callback) {
126 task_runner()->PostTask(
127 FROM_HERE, base::BindOnce(&TestService::RequestOwnershipInternal,
128 base::Unretained(this), std::move(callback)));
131 void TestService::RequestOwnershipInternal(
132 base::OnceCallback<void(bool)> callback) {
133 bus_->RequestOwnership(
134 service_name_, request_ownership_options_,
135 base::BindOnce(&TestService::OnOwnership, base::Unretained(this),
136 std::move(callback)));
139 void TestService::OnOwnership(base::OnceCallback<void(bool)> callback,
140 const std::string& service_name,
142 has_ownership_ = success;
143 LOG_IF(ERROR, !success) << "Failed to own: " << service_name;
144 std::move(callback).Run(success);
146 on_name_obtained_.Signal();
149 void TestService::ReleaseOwnership(base::OnceClosure callback) {
150 bus_->GetDBusTaskRunner()->PostTask(
151 FROM_HERE, base::BindOnce(&TestService::ReleaseOwnershipInternal,
152 base::Unretained(this), std::move(callback)));
155 void TestService::ReleaseOwnershipInternal(base::OnceClosure callback) {
156 bus_->ReleaseOwnership(service_name_);
157 has_ownership_ = false;
159 bus_->GetOriginTaskRunner()->PostTask(FROM_HERE, std::move(callback));
162 void TestService::SetSendImmediatePropertiesChanged() {
163 send_immediate_properties_changed_ = true;
166 void TestService::OnExported(const std::string& interface_name,
167 const std::string& method_name,
170 LOG(ERROR) << "Failed to export: " << interface_name << "."
172 // Returning here will make WaitUntilServiceIsStarted() to time out
177 ++num_exported_methods_;
178 if (num_exported_methods_ == kNumMethodsToExport) {
179 // As documented in exported_object.h, the service name should be
180 // requested after all methods are exposed.
181 bus_->RequestOwnership(
182 service_name_, request_ownership_options_,
183 base::BindOnce(&TestService::OnOwnership, base::Unretained(this),
188 void TestService::Run(base::RunLoop* run_loop) {
189 Bus::Options bus_options;
190 bus_options.bus_type = Bus::SESSION;
191 bus_options.connection_type = Bus::PRIVATE;
192 bus_options.dbus_task_runner = dbus_task_runner_;
193 bus_ = new Bus(bus_options);
195 exported_object_ = bus_->GetExportedObject(
196 ObjectPath("/org/chromium/TestObject"));
199 exported_object_->ExportMethod(
200 "org.chromium.TestInterface", "Echo",
201 base::BindRepeating(&TestService::Echo, base::Unretained(this)),
202 base::BindOnce(&TestService::OnExported, base::Unretained(this)));
205 exported_object_->ExportMethod(
206 "org.chromium.TestInterface", "SlowEcho",
207 base::BindRepeating(&TestService::SlowEcho, base::Unretained(this)),
208 base::BindOnce(&TestService::OnExported, base::Unretained(this)));
211 exported_object_->ExportMethod(
212 "org.chromium.TestInterface", "AsyncEcho",
213 base::BindRepeating(&TestService::AsyncEcho, base::Unretained(this)),
214 base::BindOnce(&TestService::OnExported, base::Unretained(this)));
217 exported_object_->ExportMethod(
218 "org.chromium.TestInterface", "BrokenMethod",
219 base::BindRepeating(&TestService::BrokenMethod, base::Unretained(this)),
220 base::BindOnce(&TestService::OnExported, base::Unretained(this)));
223 exported_object_->ExportMethod(
224 "org.chromium.TestInterface", "PerformAction",
225 base::BindRepeating(&TestService::PerformAction, base::Unretained(this)),
226 base::BindOnce(&TestService::OnExported, base::Unretained(this)));
229 exported_object_->ExportMethod(
230 kPropertiesInterface, kPropertiesGetAll,
231 base::BindRepeating(&TestService::GetAllProperties,
232 base::Unretained(this)),
233 base::BindOnce(&TestService::OnExported, base::Unretained(this)));
236 exported_object_->ExportMethod(
237 kPropertiesInterface, kPropertiesGet,
238 base::BindRepeating(&TestService::GetProperty, base::Unretained(this)),
239 base::BindOnce(&TestService::OnExported, base::Unretained(this)));
242 exported_object_->ExportMethod(
243 kPropertiesInterface, kPropertiesSet,
244 base::BindRepeating(&TestService::SetProperty, base::Unretained(this)),
245 base::BindOnce(&TestService::OnExported, base::Unretained(this)));
248 exported_object_manager_ = bus_->GetExportedObject(
249 ObjectPath("/org/chromium/TestService"));
251 exported_object_manager_->ExportMethod(
252 kObjectManagerInterface, kObjectManagerGetManagedObjects,
253 base::BindRepeating(&TestService::GetManagedObjects,
254 base::Unretained(this)),
255 base::BindOnce(&TestService::OnExported, base::Unretained(this)));
258 // Just print an error message as we don't want to crash tests.
259 // Tests will fail at a call to WaitUntilServiceIsStarted().
260 if (num_methods != kNumMethodsToExport) {
261 LOG(ERROR) << "The number of methods does not match";
266 void TestService::Echo(MethodCall* method_call,
267 ExportedObject::ResponseSender response_sender) {
268 MessageReader reader(method_call);
269 std::string text_message;
270 if (!reader.PopString(&text_message)) {
271 std::move(response_sender).Run(std::unique_ptr<Response>());
275 std::unique_ptr<Response> response = Response::FromMethodCall(method_call);
276 MessageWriter writer(response.get());
277 writer.AppendString(text_message);
278 std::move(response_sender).Run(std::move(response));
281 void TestService::SlowEcho(MethodCall* method_call,
282 ExportedObject::ResponseSender response_sender) {
283 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout());
284 Echo(method_call, std::move(response_sender));
287 void TestService::AsyncEcho(MethodCall* method_call,
288 ExportedObject::ResponseSender response_sender) {
289 // Schedule a call to Echo() to send an asynchronous response after we return.
290 task_runner()->PostDelayedTask(
292 base::BindOnce(&TestService::Echo, base::Unretained(this), method_call,
293 std::move(response_sender)),
294 TestTimeouts::tiny_timeout());
297 void TestService::BrokenMethod(MethodCall* method_call,
298 ExportedObject::ResponseSender response_sender) {
299 std::move(response_sender).Run(std::unique_ptr<Response>());
303 void TestService::GetAllProperties(
304 MethodCall* method_call,
305 ExportedObject::ResponseSender response_sender) {
306 MessageReader reader(method_call);
307 std::string interface;
308 if (!reader.PopString(&interface)) {
309 std::move(response_sender).Run(std::unique_ptr<Response>());
313 std::unique_ptr<Response> response = Response::FromMethodCall(method_call);
314 MessageWriter writer(response.get());
316 AddPropertiesToWriter(&writer);
318 std::move(response_sender).Run(std::move(response));
321 void TestService::GetProperty(MethodCall* method_call,
322 ExportedObject::ResponseSender response_sender) {
323 MessageReader reader(method_call);
324 std::string interface;
325 if (!reader.PopString(&interface)) {
326 std::move(response_sender).Run(std::unique_ptr<Response>());
331 if (!reader.PopString(&name)) {
332 std::move(response_sender).Run(std::unique_ptr<Response>());
336 if (name == "Name") {
337 // Return the previous value for the "Name" property:
338 // Variant<"TestService">
339 std::unique_ptr<Response> response = Response::FromMethodCall(method_call);
340 MessageWriter writer(response.get());
342 writer.AppendVariantOfString("TestService");
344 std::move(response_sender).Run(std::move(response));
345 } else if (name == "Version") {
346 // Return a new value for the "Version" property:
348 std::unique_ptr<Response> response = Response::FromMethodCall(method_call);
349 MessageWriter writer(response.get());
351 writer.AppendVariantOfInt16(20);
353 std::move(response_sender).Run(std::move(response));
354 } else if (name == "Methods") {
355 // Return the previous value for the "Methods" property:
356 // Variant<["Echo", "SlowEcho", "AsyncEcho", "BrokenMethod"]>
357 std::unique_ptr<Response> response = Response::FromMethodCall(method_call);
358 MessageWriter writer(response.get());
359 MessageWriter variant_writer(nullptr);
360 MessageWriter variant_array_writer(nullptr);
362 writer.OpenVariant("as", &variant_writer);
363 variant_writer.OpenArray("s", &variant_array_writer);
364 variant_array_writer.AppendString("Echo");
365 variant_array_writer.AppendString("SlowEcho");
366 variant_array_writer.AppendString("AsyncEcho");
367 variant_array_writer.AppendString("BrokenMethod");
368 variant_writer.CloseContainer(&variant_array_writer);
369 writer.CloseContainer(&variant_writer);
371 std::move(response_sender).Run(std::move(response));
372 } else if (name == "Objects") {
373 // Return the previous value for the "Objects" property:
374 // Variant<[objectpath:"/TestObjectPath"]>
375 std::unique_ptr<Response> response = Response::FromMethodCall(method_call);
376 MessageWriter writer(response.get());
377 MessageWriter variant_writer(nullptr);
378 MessageWriter variant_array_writer(nullptr);
380 writer.OpenVariant("ao", &variant_writer);
381 variant_writer.OpenArray("o", &variant_array_writer);
382 variant_array_writer.AppendObjectPath(ObjectPath("/TestObjectPath"));
383 variant_writer.CloseContainer(&variant_array_writer);
384 writer.CloseContainer(&variant_writer);
386 std::move(response_sender).Run(std::move(response));
387 } else if (name == "Bytes") {
388 // Return the previous value for the "Bytes" property:
389 // Variant<[0x54, 0x65, 0x73, 0x74]>
390 std::unique_ptr<Response> response = Response::FromMethodCall(method_call);
391 MessageWriter writer(response.get());
392 MessageWriter variant_writer(nullptr);
393 MessageWriter variant_array_writer(nullptr);
395 writer.OpenVariant("ay", &variant_writer);
396 const uint8_t bytes[] = {0x54, 0x65, 0x73, 0x74};
397 variant_writer.AppendArrayOfBytes(bytes, sizeof(bytes));
398 writer.CloseContainer(&variant_writer);
400 std::move(response_sender).Run(std::move(response));
403 std::move(response_sender).Run(std::unique_ptr<Response>());
408 void TestService::SetProperty(MethodCall* method_call,
409 ExportedObject::ResponseSender response_sender) {
410 MessageReader reader(method_call);
411 std::string interface;
412 if (!reader.PopString(&interface)) {
413 std::move(response_sender).Run(std::unique_ptr<Response>());
418 if (!reader.PopString(&name)) {
419 std::move(response_sender).Run(std::unique_ptr<Response>());
423 if (name != "Name") {
424 std::move(response_sender).Run(std::unique_ptr<Response>());
429 if (!reader.PopVariantOfString(&value)) {
430 std::move(response_sender).Run(std::unique_ptr<Response>());
434 SendPropertyChangedSignal(value);
436 std::move(response_sender).Run(Response::FromMethodCall(method_call));
439 void TestService::PerformAction(
440 MethodCall* method_call,
441 ExportedObject::ResponseSender response_sender) {
442 MessageReader reader(method_call);
444 ObjectPath object_path;
445 if (!reader.PopString(&action) || !reader.PopObjectPath(&object_path)) {
446 std::move(response_sender).Run(std::unique_ptr<Response>());
450 if (action == "AddObject") {
451 AddObject(object_path);
452 } else if (action == "RemoveObject") {
453 RemoveObject(object_path);
454 } else if (action == "SetSendImmediatePropertiesChanged") {
455 SetSendImmediatePropertiesChanged();
456 } else if (action == "ReleaseOwnership") {
457 ReleaseOwnership(base::BindOnce(&TestService::PerformActionResponse,
458 base::Unretained(this), method_call,
459 std::move(response_sender)));
461 } else if (action == "Ownership") {
462 ReleaseOwnership(base::BindOnce(&TestService::OwnershipReleased,
463 base::Unretained(this), method_call,
464 std::move(response_sender)));
466 } else if (action == "InvalidateProperty") {
467 SendPropertyInvalidatedSignal();
470 std::unique_ptr<Response> response = Response::FromMethodCall(method_call);
471 std::move(response_sender).Run(std::move(response));
474 void TestService::PerformActionResponse(
475 MethodCall* method_call,
476 ExportedObject::ResponseSender response_sender) {
477 std::unique_ptr<Response> response = Response::FromMethodCall(method_call);
478 std::move(response_sender).Run(std::move(response));
481 void TestService::OwnershipReleased(
482 MethodCall* method_call,
483 ExportedObject::ResponseSender response_sender) {
484 RequestOwnership(base::BindOnce(&TestService::OwnershipRegained,
485 base::Unretained(this), method_call,
486 std::move(response_sender)));
490 void TestService::OwnershipRegained(
491 MethodCall* method_call,
492 ExportedObject::ResponseSender response_sender,
494 PerformActionResponse(method_call, std::move(response_sender));
498 void TestService::GetManagedObjects(
499 MethodCall* method_call,
500 ExportedObject::ResponseSender response_sender) {
501 std::unique_ptr<Response> response = Response::FromMethodCall(method_call);
502 MessageWriter writer(response.get());
504 // The managed objects response is a dictionary of object paths identifying
505 // the object(s) with a dictionary of strings identifying the interface(s)
506 // they implement and then a dictionary of property values.
508 // Thus this looks something like:
511 // "/org/chromium/TestObject": {
512 // "org.chromium.TestInterface": { /* Properties */ }
517 MessageWriter array_writer(nullptr);
518 MessageWriter dict_entry_writer(nullptr);
519 MessageWriter object_array_writer(nullptr);
520 MessageWriter object_dict_entry_writer(nullptr);
522 writer.OpenArray("{oa{sa{sv}}}", &array_writer);
524 array_writer.OpenDictEntry(&dict_entry_writer);
525 dict_entry_writer.AppendObjectPath(ObjectPath("/org/chromium/TestObject"));
526 dict_entry_writer.OpenArray("{sa{sv}}", &object_array_writer);
528 object_array_writer.OpenDictEntry(&object_dict_entry_writer);
529 object_dict_entry_writer.AppendString("org.chromium.TestInterface");
530 AddPropertiesToWriter(&object_dict_entry_writer);
531 object_array_writer.CloseContainer(&object_dict_entry_writer);
533 dict_entry_writer.CloseContainer(&object_array_writer);
535 array_writer.CloseContainer(&dict_entry_writer);
536 writer.CloseContainer(&array_writer);
538 std::move(response_sender).Run(std::move(response));
540 if (send_immediate_properties_changed_)
541 SendPropertyChangedSignal("ChangedTestServiceName");
544 void TestService::AddPropertiesToWriter(MessageWriter* writer) {
545 // The properties response is a dictionary of strings identifying the
546 // property and a variant containing the property value. We return all
547 // of the properties, thus the response is:
550 // "Name": Variant<"TestService">,
551 // "Version": Variant<10>,
552 // "Methods": Variant<["Echo", "SlowEcho", "AsyncEcho", "BrokenMethod"]>,
553 // "Objects": Variant<[objectpath:"/TestObjectPath"]>
554 // "Bytes": Variant<[0x54, 0x65, 0x73, 0x74]>
557 MessageWriter array_writer(nullptr);
558 MessageWriter dict_entry_writer(nullptr);
559 MessageWriter variant_writer(nullptr);
560 MessageWriter variant_array_writer(nullptr);
562 writer->OpenArray("{sv}", &array_writer);
564 array_writer.OpenDictEntry(&dict_entry_writer);
565 dict_entry_writer.AppendString("Name");
566 dict_entry_writer.AppendVariantOfString("TestService");
567 array_writer.CloseContainer(&dict_entry_writer);
569 array_writer.OpenDictEntry(&dict_entry_writer);
570 dict_entry_writer.AppendString("Version");
571 dict_entry_writer.AppendVariantOfInt16(10);
572 array_writer.CloseContainer(&dict_entry_writer);
574 array_writer.OpenDictEntry(&dict_entry_writer);
575 dict_entry_writer.AppendString("Methods");
576 dict_entry_writer.OpenVariant("as", &variant_writer);
577 variant_writer.OpenArray("s", &variant_array_writer);
578 variant_array_writer.AppendString("Echo");
579 variant_array_writer.AppendString("SlowEcho");
580 variant_array_writer.AppendString("AsyncEcho");
581 variant_array_writer.AppendString("BrokenMethod");
582 variant_writer.CloseContainer(&variant_array_writer);
583 dict_entry_writer.CloseContainer(&variant_writer);
584 array_writer.CloseContainer(&dict_entry_writer);
586 array_writer.OpenDictEntry(&dict_entry_writer);
587 dict_entry_writer.AppendString("Objects");
588 dict_entry_writer.OpenVariant("ao", &variant_writer);
589 variant_writer.OpenArray("o", &variant_array_writer);
590 variant_array_writer.AppendObjectPath(ObjectPath("/TestObjectPath"));
591 variant_writer.CloseContainer(&variant_array_writer);
592 dict_entry_writer.CloseContainer(&variant_writer);
593 array_writer.CloseContainer(&dict_entry_writer);
595 array_writer.OpenDictEntry(&dict_entry_writer);
596 dict_entry_writer.AppendString("Bytes");
597 dict_entry_writer.OpenVariant("ay", &variant_writer);
598 const uint8_t bytes[] = {0x54, 0x65, 0x73, 0x74};
599 variant_writer.AppendArrayOfBytes(bytes, sizeof(bytes));
600 dict_entry_writer.CloseContainer(&variant_writer);
601 array_writer.CloseContainer(&dict_entry_writer);
603 writer->CloseContainer(&array_writer);
606 void TestService::AddObject(const ObjectPath& object_path) {
607 task_runner()->PostTask(FROM_HERE,
608 base::BindOnce(&TestService::AddObjectInternal,
609 base::Unretained(this), object_path));
612 void TestService::AddObjectInternal(const ObjectPath& object_path) {
613 Signal signal(kObjectManagerInterface, kObjectManagerInterfacesAdded);
614 MessageWriter writer(&signal);
615 writer.AppendObjectPath(object_path);
617 MessageWriter array_writer(nullptr);
618 MessageWriter dict_entry_writer(nullptr);
620 writer.OpenArray("{sa{sv}}", &array_writer);
621 array_writer.OpenDictEntry(&dict_entry_writer);
622 dict_entry_writer.AppendString("org.chromium.TestInterface");
623 AddPropertiesToWriter(&dict_entry_writer);
624 array_writer.CloseContainer(&dict_entry_writer);
625 writer.CloseContainer(&array_writer);
627 exported_object_manager_->SendSignal(&signal);
630 void TestService::RemoveObject(const ObjectPath& object_path) {
631 task_runner()->PostTask(FROM_HERE,
632 base::BindOnce(&TestService::RemoveObjectInternal,
633 base::Unretained(this), object_path));
636 void TestService::RemoveObjectInternal(const ObjectPath& object_path) {
637 Signal signal(kObjectManagerInterface, kObjectManagerInterfacesRemoved);
638 MessageWriter writer(&signal);
640 writer.AppendObjectPath(object_path);
642 std::vector<std::string> interfaces;
643 interfaces.push_back("org.chromium.TestInterface");
644 writer.AppendArrayOfStrings(interfaces);
646 exported_object_manager_->SendSignal(&signal);
649 void TestService::SendPropertyChangedSignal(const std::string& name) {
650 task_runner()->PostTask(
651 FROM_HERE, base::BindOnce(&TestService::SendPropertyChangedSignalInternal,
652 base::Unretained(this), name));
655 void TestService::SendPropertyChangedSignalInternal(const std::string& name) {
656 Signal signal(kPropertiesInterface, kPropertiesChanged);
657 MessageWriter writer(&signal);
658 writer.AppendString("org.chromium.TestInterface");
660 MessageWriter array_writer(nullptr);
661 MessageWriter dict_entry_writer(nullptr);
663 writer.OpenArray("{sv}", &array_writer);
664 array_writer.OpenDictEntry(&dict_entry_writer);
665 dict_entry_writer.AppendString("Name");
666 dict_entry_writer.AppendVariantOfString(name);
667 array_writer.CloseContainer(&dict_entry_writer);
668 writer.CloseContainer(&array_writer);
670 MessageWriter invalidated_array_writer(nullptr);
672 writer.OpenArray("s", &invalidated_array_writer);
673 writer.CloseContainer(&invalidated_array_writer);
675 exported_object_->SendSignal(&signal);
678 void TestService::SendPropertyInvalidatedSignal() {
679 task_runner()->PostTask(
681 base::BindOnce(&TestService::SendPropertyInvalidatedSignalInternal,
682 base::Unretained(this)));
685 void TestService::SendPropertyInvalidatedSignalInternal() {
686 Signal signal(kPropertiesInterface, kPropertiesChanged);
687 MessageWriter writer(&signal);
688 writer.AppendString("org.chromium.TestInterface");
690 MessageWriter array_writer(nullptr);
691 MessageWriter dict_entry_writer(nullptr);
693 writer.OpenArray("{sv}", &array_writer);
694 writer.CloseContainer(&array_writer);
696 MessageWriter invalidated_array_writer(nullptr);
698 writer.OpenArray("s", &invalidated_array_writer);
699 invalidated_array_writer.AppendString("Name");
700 writer.CloseContainer(&invalidated_array_writer);
702 exported_object_->SendSignal(&signal);