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

Unified Diff: content/renderer/media/webrtc_logging_handler_impl_unittest.cc

Issue 15741003: Moving WebRTC logging related files from content to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 7 years, 7 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
Index: content/renderer/media/webrtc_logging_handler_impl_unittest.cc
diff --git a/content/renderer/media/webrtc_logging_handler_impl_unittest.cc b/content/renderer/media/webrtc_logging_handler_impl_unittest.cc
deleted file mode 100644
index fc70baa8aeedc01fa2c693e26ddc420121015de1..0000000000000000000000000000000000000000
--- a/content/renderer/media/webrtc_logging_handler_impl_unittest.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2013 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.
-
-#include <string>
-
-#include "base/process_util.h"
-#include "content/common/partial_circular_buffer.h"
-#include "content/renderer/media/webrtc_logging_handler_impl.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace content {
-
-TEST(WebRtcLoggingHandlerImplTest, Basic) {
- const uint32 kTestLogSize = 1024; // 1 KB
- const char kTestString[] = "abcdefghijklmnopqrstuvwxyz";
-
- base::MessageLoop message_loop(base::MessageLoop::TYPE_IO);
-
- scoped_ptr<WebRtcLoggingHandlerImpl> logging_handler(
- new WebRtcLoggingHandlerImpl(message_loop.message_loop_proxy()));
-
- base::SharedMemory shared_memory;
- ASSERT_TRUE(shared_memory.CreateAndMapAnonymous(kTestLogSize));
- base::SharedMemoryHandle new_handle;
- ASSERT_TRUE(shared_memory.ShareToProcess(base::GetCurrentProcessHandle(),
- &new_handle));
- logging_handler->OnLogOpened(new_handle, kTestLogSize);
-
- logging_handler->LogMessage(kTestString);
- logging_handler->LogMessage(kTestString);
-
- content::PartialCircularBuffer read_pcb(
- reinterpret_cast<uint8*>(shared_memory.memory()), kTestLogSize);
-
- // Size is calculated as (sizeof(kTestString) - 1 for terminating null
- // + 1 for eol added for each log message in LogMessage) * 2 + 1 for
- // terminating null.
- char read_buffer[sizeof(kTestString) * 2 + 1] = {0};
-
- uint32 read = read_pcb.Read(read_buffer, sizeof(read_buffer));
- EXPECT_EQ(sizeof(read_buffer) - 1, read);
- std::string ref_output = kTestString;
- ref_output.append("\n");
- ref_output.append(kTestString);
- ref_output.append("\n");
- EXPECT_STREQ(ref_output.c_str(), read_buffer);
-}
-
-} // namespace content

Powered by Google App Engine
This is Rietveld 408576698