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

Side by Side Diff: base/message_pump_libevent_unittest.cc

Issue 7232002: net doesn't depend on libevent directly now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: No need to include message_pump_libevent.h Created 9 years, 6 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
« no previous file with comments | « base/message_loop_unittest.cc ('k') | net/base/listen_socket.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 24 matching lines...) Expand all
35 base::Thread io_thread_; 35 base::Thread io_thread_;
36 DISALLOW_COPY_AND_ASSIGN(MessagePumpLibeventTest); 36 DISALLOW_COPY_AND_ASSIGN(MessagePumpLibeventTest);
37 }; 37 };
38 38
39 // Concrete implementation of base::MessagePumpLibevent::Watcher that does 39 // Concrete implementation of base::MessagePumpLibevent::Watcher that does
40 // nothing useful. 40 // nothing useful.
41 class StupidWatcher : public base::MessagePumpLibevent::Watcher { 41 class StupidWatcher : public base::MessagePumpLibevent::Watcher {
42 public: 42 public:
43 virtual ~StupidWatcher() {} 43 virtual ~StupidWatcher() {}
44 44
45 // base:MessagePumpLibEvent::Watcher interface 45 // base:MessagePumpLibevent::Watcher interface
46 virtual void OnFileCanReadWithoutBlocking(int fd) {} 46 virtual void OnFileCanReadWithoutBlocking(int fd) {}
47 virtual void OnFileCanWriteWithoutBlocking(int fd) {} 47 virtual void OnFileCanWriteWithoutBlocking(int fd) {}
48 }; 48 };
49 49
50 } // namespace 50 } // namespace
51 51
52 #if GTEST_HAS_DEATH_TEST 52 #if GTEST_HAS_DEATH_TEST
53 53
54 // Test to make sure that we catch calling WatchFileDescriptor off of the 54 // Test to make sure that we catch calling WatchFileDescriptor off of the
55 // wrong thread. 55 // wrong thread.
56 TEST_F(MessagePumpLibeventTest, TestWatchingFromBadThread) { 56 TEST_F(MessagePumpLibeventTest, TestWatchingFromBadThread) {
57 base::MessagePumpLibevent::FileDescriptorWatcher watcher; 57 base::MessagePumpLibevent::FileDescriptorWatcher watcher;
58 StupidWatcher delegate; 58 StupidWatcher delegate;
59 59
60 ASSERT_DEBUG_DEATH(io_loop()->WatchFileDescriptor( 60 ASSERT_DEBUG_DEATH(io_loop()->WatchFileDescriptor(
61 STDOUT_FILENO, false, MessageLoopForIO::WATCH_READ, &watcher, &delegate), 61 STDOUT_FILENO, false, MessageLoopForIO::WATCH_READ, &watcher, &delegate),
62 "Check failed: " 62 "Check failed: "
63 "watch_file_descriptor_caller_checker_.CalledOnValidThread()"); 63 "watch_file_descriptor_caller_checker_.CalledOnValidThread()");
64 } 64 }
65 65
66 #endif // GTEST_HAS_DEATH_TEST 66 #endif // GTEST_HAS_DEATH_TEST
OLDNEW
« no previous file with comments | « base/message_loop_unittest.cc ('k') | net/base/listen_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698