| Index: media/video/capture/screen/shared_buffer_unittest.cc
|
| diff --git a/remoting/capturer/shared_buffer_unittest.cc b/media/video/capture/screen/shared_buffer_unittest.cc
|
| similarity index 75%
|
| rename from remoting/capturer/shared_buffer_unittest.cc
|
| rename to media/video/capture/screen/shared_buffer_unittest.cc
|
| index b065f5cb3f96652bd031397739707591d253d215..1efc798459dc8b502c9a2115470677630a1ddbad 100644
|
| --- a/remoting/capturer/shared_buffer_unittest.cc
|
| +++ b/media/video/capture/screen/shared_buffer_unittest.cc
|
| @@ -3,8 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/process_util.h"
|
| -#include "ipc/ipc_platform_file.h"
|
| -#include "remoting/capturer/shared_buffer.h"
|
| +#include "media/video/capture/screen/shared_buffer.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| const uint32 kBufferSize = 4096;
|
| @@ -13,7 +12,7 @@ const int kPattern = 0x12345678;
|
| const int kIdZero = 0;
|
| const int kIdOne = 1;
|
|
|
| -namespace remoting {
|
| +namespace media {
|
|
|
| TEST(SharedBufferTest, Basic) {
|
| scoped_refptr<SharedBuffer> source(new SharedBuffer(kBufferSize));
|
| @@ -28,15 +27,9 @@ TEST(SharedBufferTest, Basic) {
|
| source->set_id(kIdOne);
|
| EXPECT_EQ(source->id(), kIdOne);
|
|
|
| -#if defined(OS_POSIX)
|
| - base::PlatformFile source_handle = source->handle().fd;
|
| -#else // !defined(OS_POSIX)
|
| - base::PlatformFile source_handle = source->handle();
|
| -#endif // !defined(OS_POSIX)
|
| -
|
| - // Duplicate the source handle.
|
| - IPC::PlatformFileForTransit copied_handle = IPC::GetFileHandleForProcess(
|
| - source_handle, base::GetCurrentProcessHandle(), false);
|
| + base::SharedMemoryHandle copied_handle;
|
| + EXPECT_TRUE(source->ShareToProcess(
|
| + base::GetCurrentProcessHandle(), &copied_handle));
|
|
|
| scoped_refptr<SharedBuffer> dest(
|
| new SharedBuffer(kIdZero, copied_handle, kBufferSize));
|
| @@ -59,4 +52,4 @@ TEST(SharedBufferTest, Basic) {
|
| EXPECT_EQ(0x12345678, *dest_ptr);
|
| }
|
|
|
| -} // namespace remoting
|
| +} // namespace media
|
|
|