Index: chromeos/binder/test_service.h |
diff --git a/chromeos/binder/test_service.h b/chromeos/binder/test_service.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c88c759a3ebc2c10d30e5861c12626dbd4347380 |
--- /dev/null |
+++ b/chromeos/binder/test_service.h |
@@ -0,0 +1,48 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROMEOS_BINDER_TEST_SERVICE_H_ |
+#define CHROMEOS_BINDER_TEST_SERVICE_H_ |
+ |
+#include "base/macros.h" |
+#include "base/strings/string16.h" |
+#include "chromeos/binder/constants.h" |
+#include "chromeos/binder/thread.h" |
+ |
+namespace binder { |
+ |
+// Service for testing. |
+// Opens binder driver on its own thread and provides a service. |
satorux1
2016/01/13 04:33:20
Maybe document that the service runs in the same p
hashimoto
2016/01/13 05:46:46
I'm not sure if there is any test running in a dif
satorux1
2016/01/14 05:47:16
Then how about documenting that the service runs i
hashimoto
2016/01/14 06:24:29
Added a note.
|
+class TestService { |
+ public: |
+ enum { |
+ INCREMENT_INT_TRANSACTION = kFirstTransactionCode, |
+ }; |
+ |
+ TestService(); |
+ ~TestService(); |
+ |
+ // The name of this service. |
+ const base::string16& service_name() const { return service_name_; } |
+ |
+ // Starts and waits for the service to start. |
satorux1
2016/01/13 04:33:20
please document the return value.
hashimoto
2016/01/13 05:46:46
Done.
|
+ bool StartAndWait(); |
+ |
+ // Stops this service. |
+ void Stop(); |
+ |
+ private: |
+ class TestObject; |
+ |
+ void Initialize(bool* result); |
satorux1
2016/01/13 04:33:20
function comment is missing.
hashimoto
2016/01/13 05:46:46
Done.
|
+ |
+ base::string16 service_name_; |
+ Thread thread_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TestService); |
+}; |
+ |
+} // namespace binder |
+ |
+#endif // CHROMEOS_BINDER_TEST_SERVICE_H_ |