Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1253)

Unified Diff: media/video/capture/screen/shared_buffer_unittest.cc

Issue 12047101: Move screen capturers from remoting/capturer to media/video/capturer/screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/video/capture/screen/shared_buffer_factory.h ('k') | media/video/capture/screen/win/desktop.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « media/video/capture/screen/shared_buffer_factory.h ('k') | media/video/capture/screen/win/desktop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698