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

Side by Side Diff: base/message_pump_libevent_unittest.cc

Issue 11412101: Provide an iOS message pump for IO implementation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Response to reviews Created 8 years 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
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 "base/message_pump_libevent.h" 5 #include "base/message_pump_libevent.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/posix/eintr_wrapper.h" 10 #include "base/posix/eintr_wrapper.h"
(...skipping 12 matching lines...) Expand all
23 protected: 23 protected:
24 MessagePumpLibeventTest() 24 MessagePumpLibeventTest()
25 : ui_loop_(MessageLoop::TYPE_UI), 25 : ui_loop_(MessageLoop::TYPE_UI),
26 io_thread_("MessagePumpLibeventTestIOThread") {} 26 io_thread_("MessagePumpLibeventTestIOThread") {}
27 virtual ~MessagePumpLibeventTest() {} 27 virtual ~MessagePumpLibeventTest() {}
28 28
29 virtual void SetUp() OVERRIDE { 29 virtual void SetUp() OVERRIDE {
30 Thread::Options options(MessageLoop::TYPE_IO, 0); 30 Thread::Options options(MessageLoop::TYPE_IO, 0);
31 ASSERT_TRUE(io_thread_.StartWithOptions(options)); 31 ASSERT_TRUE(io_thread_.StartWithOptions(options));
32 ASSERT_EQ(MessageLoop::TYPE_IO, io_thread_.message_loop()->type()); 32 ASSERT_EQ(MessageLoop::TYPE_IO, io_thread_.message_loop()->type());
33 int err = pipe(pipefds_); 33 int ret = pipe(pipefds_);
34 ASSERT_EQ(0, err); 34 ASSERT_EQ(0, ret);
35 } 35 }
36 36
37 virtual void TearDown() OVERRIDE { 37 virtual void TearDown() OVERRIDE {
38 if (HANDLE_EINTR(close(pipefds_[0])) < 0) 38 if (HANDLE_EINTR(close(pipefds_[0])) < 0)
39 PLOG(ERROR) << "close"; 39 PLOG(ERROR) << "close";
40 if (HANDLE_EINTR(close(pipefds_[1])) < 0) 40 if (HANDLE_EINTR(close(pipefds_[1])) < 0)
41 PLOG(ERROR) << "close"; 41 PLOG(ERROR) << "close";
42 } 42 }
43 43
44 MessageLoop* ui_loop() { return &ui_loop_; } 44 MessageLoop* ui_loop() { return &ui_loop_; }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 pump->WatchFileDescriptor(pipefds_[1], 156 pump->WatchFileDescriptor(pipefds_[1],
157 false, MessagePumpLibevent::WATCH_READ_WRITE, &watcher, &delegate); 157 false, MessagePumpLibevent::WATCH_READ_WRITE, &watcher, &delegate);
158 158
159 // Spoof a libevent notification. 159 // Spoof a libevent notification.
160 OnLibeventNotification(pump, &watcher); 160 OnLibeventNotification(pump, &watcher);
161 } 161 }
162 162
163 } // namespace 163 } // namespace
164 164
165 } // namespace base 165 } // namespace base
OLDNEW
« base/message_pump_io_ios_unittest.cc ('K') | « base/message_pump_libevent.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698