| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef DBUS_TEST_SERVICE_H_ | 5 #ifndef DBUS_TEST_SERVICE_H_ |
| 6 #define DBUS_TEST_SERVICE_H_ | 6 #define DBUS_TEST_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 // Shuts down the service and blocks until it's done. | 56 // Shuts down the service and blocks until it's done. |
| 57 void ShutdownAndBlock(); | 57 void ShutdownAndBlock(); |
| 58 | 58 |
| 59 // Returns true if the bus has the D-Bus thread. | 59 // Returns true if the bus has the D-Bus thread. |
| 60 bool HasDBusThread(); | 60 bool HasDBusThread(); |
| 61 | 61 |
| 62 // Sends "Test" signal with the given message from the exported object. | 62 // Sends "Test" signal with the given message from the exported object. |
| 63 void SendTestSignal(const std::string& message); | 63 void SendTestSignal(const std::string& message); |
| 64 | 64 |
| 65 // Sends "Test" signal with the given message from the root object ("/"). |
| 66 // This function emulates dbus-send's behavior. |
| 67 void SendTestSignalFromRoot(const std::string& message); |
| 68 |
| 65 private: | 69 private: |
| 66 // Helper function for SendTestSignal(). | 70 // Helper function for SendTestSignal(). |
| 67 void SendTestSignalInternal(const std::string& message); | 71 void SendTestSignalInternal(const std::string& message); |
| 68 | 72 |
| 73 // Helper function for SendTestSignalFromRoot. |
| 74 void SendTestSignalFromRootInternal(const std::string& message); |
| 75 |
| 69 // Helper function for ShutdownAndBlock(). | 76 // Helper function for ShutdownAndBlock(). |
| 70 void ShutdownAndBlockInternal(); | 77 void ShutdownAndBlockInternal(); |
| 71 | 78 |
| 72 // Called when a method is exported. | 79 // Called when a method is exported. |
| 73 void OnExported(const std::string& interface_name, | 80 void OnExported(const std::string& interface_name, |
| 74 const std::string& method_name, | 81 const std::string& method_name, |
| 75 bool success); | 82 bool success); |
| 76 | 83 |
| 77 // base::Thread override. | 84 // base::Thread override. |
| 78 virtual void Run(MessageLoop* message_loop); | 85 virtual void Run(MessageLoop* message_loop); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 96 // The number of methods actually exported. | 103 // The number of methods actually exported. |
| 97 int num_exported_methods_; | 104 int num_exported_methods_; |
| 98 | 105 |
| 99 scoped_refptr<Bus> bus_; | 106 scoped_refptr<Bus> bus_; |
| 100 ExportedObject* exported_object_; | 107 ExportedObject* exported_object_; |
| 101 }; | 108 }; |
| 102 | 109 |
| 103 } // namespace dbus | 110 } // namespace dbus |
| 104 | 111 |
| 105 #endif // DBUS_TEST_SERVICE_H_ | 112 #endif // DBUS_TEST_SERVICE_H_ |
| OLD | NEW |