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

Side by Side Diff: chrome/renderer/media/chrome_webrtc_log_message_delegate_unittest.cc

Issue 136683004: Removes MessageLoop::TYPE_XXX where possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resolve merge Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/process/process_handle.h" 7 #include "base/process/process_handle.h"
8 #include "chrome/common/partial_circular_buffer.h" 8 #include "chrome/common/partial_circular_buffer.h"
9 #include "chrome/renderer/media/chrome_webrtc_log_message_delegate.h" 9 #include "chrome/renderer/media/chrome_webrtc_log_message_delegate.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 TEST(ChromeWebRtcLogMessageDelegateTest, Basic) { 12 TEST(ChromeWebRtcLogMessageDelegateTest, Basic) {
13 const uint32 kTestLogSize = 1024; // 1 KB 13 const uint32 kTestLogSize = 1024; // 1 KB
14 const char kTestString[] = "abcdefghijklmnopqrstuvwxyz"; 14 const char kTestString[] = "abcdefghijklmnopqrstuvwxyz";
15 15
16 base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); 16 base::MessageLoopForIO message_loop;
17 17
18 scoped_ptr<ChromeWebRtcLogMessageDelegate> log_message_delegate( 18 scoped_ptr<ChromeWebRtcLogMessageDelegate> log_message_delegate(
19 new ChromeWebRtcLogMessageDelegate(message_loop.message_loop_proxy(), 19 new ChromeWebRtcLogMessageDelegate(message_loop.message_loop_proxy(),
20 NULL)); 20 NULL));
21 21
22 base::SharedMemory shared_memory; 22 base::SharedMemory shared_memory;
23 ASSERT_TRUE(shared_memory.CreateAndMapAnonymous(kTestLogSize)); 23 ASSERT_TRUE(shared_memory.CreateAndMapAnonymous(kTestLogSize));
24 base::SharedMemoryHandle new_handle; 24 base::SharedMemoryHandle new_handle;
25 ASSERT_TRUE(shared_memory.ShareToProcess(base::GetCurrentProcessHandle(), 25 ASSERT_TRUE(shared_memory.ShareToProcess(base::GetCurrentProcessHandle(),
26 &new_handle)); 26 &new_handle));
(...skipping 19 matching lines...) Expand all
46 char read_buffer[kExpectedSize * 2] = {0}; 46 char read_buffer[kExpectedSize * 2] = {0};
47 47
48 uint32 read = read_pcb.Read(read_buffer, kExpectedSize * 2); 48 uint32 read = read_pcb.Read(read_buffer, kExpectedSize * 2);
49 EXPECT_EQ(kExpectedSize, read); 49 EXPECT_EQ(kExpectedSize, read);
50 std::string ref_output = kTestString; 50 std::string ref_output = kTestString;
51 ref_output.append("\n"); 51 ref_output.append("\n");
52 ref_output.append(kTestString); 52 ref_output.append(kTestString);
53 ref_output.append("\n"); 53 ref_output.append("\n");
54 EXPECT_STREQ(ref_output.c_str(), read_buffer); 54 EXPECT_STREQ(ref_output.c_str(), read_buffer);
55 } 55 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_syncable_service_unittest.cc ('k') | cloud_print/gcp20/prototype/gcp20_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698