Index: native_client_sdk/src/tests/nacl_io_test/fake_messaging_interface.h |
diff --git a/native_client_sdk/src/tests/nacl_io_test/fake_messaging_interface.h b/native_client_sdk/src/tests/nacl_io_test/fake_messaging_interface.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..55169e4d731b1a4ec4dcd6a0d1fd09bf47540940 |
--- /dev/null |
+++ b/native_client_sdk/src/tests/nacl_io_test/fake_messaging_interface.h |
@@ -0,0 +1,34 @@ |
+// Copyright (c) 2014 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 TESTS_NACL_IO_TEST_FAKE_MESSAGING_INTERFACE_H_ |
+#define TESTS_NACL_IO_TEST_FAKE_MESSAGING_INTERFACE_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "nacl_io/pepper_interface.h" |
+#include "sdk_util/macros.h" |
+ |
+class FakeVarManager; |
+ |
+// Fake version of the MessagingInterface which simply records any |
+// messages sent to it via PostMessage and makes them available as |
+// a std::vector of std::string. |
+class FakeMessagingInterface : public nacl_io::MessagingInterface { |
+ public: |
+ explicit FakeMessagingInterface(FakeVarManager* manager, |
binji
2014/01/17 01:31:14
remove explicit for 2 arg constructor
Sam Clegg
2014/01/17 22:40:11
Done.
|
+ nacl_io::VarInterface* var_interface); |
+ ~FakeMessagingInterface(); |
+ |
+ virtual void PostMessage(PP_Instance instance, PP_Var message); |
+ |
+ std::vector<PP_Var> messages; |
+ private: |
+ FakeVarManager* manager_; |
+ nacl_io::VarInterface* var_interface_; |
+ DISALLOW_COPY_AND_ASSIGN(FakeMessagingInterface); |
+}; |
+ |
+#endif // TESTS_NACL_IO_TEST_FAKE_MESSAGING_INTERFACE_H_ |