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

Side by Side Diff: base/message_loop/message_pump_libevent_unittest.cc

Issue 2213933003: Change EXPECT/ASSERT_DCHECK_DEATH macro to not expose the |regex| parameter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b2b0_simplethreadJoinable
Patch Set: Disabling a death test which crashed instead of DCHECKing : http://crbug.com/634552 Created 4 years, 4 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
« no previous file with comments | « base/message_loop/message_pump_io_ios_unittest.cc ('k') | base/metrics/field_trial_unittest.cc » ('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) 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_loop/message_pump_libevent.h" 5 #include "base/message_loop/message_pump_libevent.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #else 86 #else
87 #define MAYBE_TestWatchingFromBadThread TestWatchingFromBadThread 87 #define MAYBE_TestWatchingFromBadThread TestWatchingFromBadThread
88 #endif 88 #endif
89 TEST_F(MessagePumpLibeventTest, MAYBE_TestWatchingFromBadThread) { 89 TEST_F(MessagePumpLibeventTest, MAYBE_TestWatchingFromBadThread) {
90 MessagePumpLibevent::FileDescriptorWatcher watcher; 90 MessagePumpLibevent::FileDescriptorWatcher watcher;
91 StupidWatcher delegate; 91 StupidWatcher delegate;
92 92
93 ASSERT_DCHECK_DEATH( 93 ASSERT_DCHECK_DEATH(
94 io_loop()->WatchFileDescriptor(STDOUT_FILENO, false, 94 io_loop()->WatchFileDescriptor(STDOUT_FILENO, false,
95 MessageLoopForIO::WATCH_READ, &watcher, 95 MessageLoopForIO::WATCH_READ, &watcher,
96 &delegate), 96 &delegate));
97 "Check failed: "
98 "watch_file_descriptor_caller_checker_.CalledOnValidThread\\(\\)");
99 } 97 }
100 98
101 TEST_F(MessagePumpLibeventTest, QuitOutsideOfRun) { 99 TEST_F(MessagePumpLibeventTest, QuitOutsideOfRun) {
102 std::unique_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent); 100 std::unique_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent);
103 ASSERT_DCHECK_DEATH(pump->Quit(), 101 ASSERT_DCHECK_DEATH(pump->Quit());
104 "Check failed: in_run_. "
105 "Quit was called outside of Run!");
106 } 102 }
107 103
108 class BaseWatcher : public MessagePumpLibevent::Watcher { 104 class BaseWatcher : public MessagePumpLibevent::Watcher {
109 public: 105 public:
110 explicit BaseWatcher(MessagePumpLibevent::FileDescriptorWatcher* controller) 106 explicit BaseWatcher(MessagePumpLibevent::FileDescriptorWatcher* controller)
111 : controller_(controller) { 107 : controller_(controller) {
112 DCHECK(controller_); 108 DCHECK(controller_);
113 } 109 }
114 ~BaseWatcher() override {} 110 ~BaseWatcher() override {}
115 111
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 272
277 // StartWatching can move |watcher| to IO thread. Release on IO thread. 273 // StartWatching can move |watcher| to IO thread. Release on IO thread.
278 io_loop()->task_runner()->PostTask( 274 io_loop()->task_runner()->PostTask(
279 FROM_HERE, 275 FROM_HERE,
280 Bind(&WaitableEventWatcher::StopWatching, Owned(watcher.release()))); 276 Bind(&WaitableEventWatcher::StopWatching, Owned(watcher.release())));
281 } 277 }
282 278
283 } // namespace 279 } // namespace
284 280
285 } // namespace base 281 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_io_ios_unittest.cc ('k') | base/metrics/field_trial_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698