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

Side by Side Diff: content/renderer/pepper/pepper_broker_impl_unittest.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/pepper/pepper_broker_impl.h" 5 #include "content/renderer/pepper/pepper_broker_impl.h"
6 6
7 #if defined(OS_POSIX) 7 #if defined(OS_POSIX)
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #endif // defined(OS_POSIX) 10 #endif // defined(OS_POSIX)
11 11
12 #include "content/test/mock_render_process.h" 12 #include "content/test/mock_render_process.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 class PepperBrokerImplTest : public ::testing::Test { 17 class PepperBrokerImplTest : public ::testing::Test {
18 protected: 18 protected:
19 MessageLoopForIO message_loop_; 19 base::MessageLoopForIO message_loop_;
20 // We need a render process for ppapi::proxy::ProxyChannel to work. 20 // We need a render process for ppapi::proxy::ProxyChannel to work.
21 MockRenderProcess mock_process_; 21 MockRenderProcess mock_process_;
22 }; 22 };
23 23
24 // Try to initialize PepperBrokerDispatcherWrapper with invalid ChannelHandle. 24 // Try to initialize PepperBrokerDispatcherWrapper with invalid ChannelHandle.
25 // Initialization should fail. 25 // Initialization should fail.
26 TEST_F(PepperBrokerImplTest, InitFailure) { 26 TEST_F(PepperBrokerImplTest, InitFailure) {
27 PepperBrokerDispatcherWrapper dispatcher_wrapper; 27 PepperBrokerDispatcherWrapper dispatcher_wrapper;
28 IPC::ChannelHandle invalid_channel; // Invalid by default. 28 IPC::ChannelHandle invalid_channel; // Invalid by default.
29 29
(...skipping 21 matching lines...) Expand all
51 #endif // defined(OS_POSIX)); 51 #endif // defined(OS_POSIX));
52 52
53 EXPECT_TRUE(dispatcher_wrapper.Init(base::kNullProcessId, valid_channel)); 53 EXPECT_TRUE(dispatcher_wrapper.Init(base::kNullProcessId, valid_channel));
54 54
55 #if defined(OS_POSIX) 55 #if defined(OS_POSIX)
56 EXPECT_EQ(0, ::close(fds[0])); 56 EXPECT_EQ(0, ::close(fds[0]));
57 #endif // defined(OS_POSIX)); 57 #endif // defined(OS_POSIX));
58 } 58 }
59 59
60 } // namespace content 60 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/p2p/ipc_socket_factory.cc ('k') | content/renderer/pepper/pepper_device_enumeration_host_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698