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

Side by Side Diff: base/message_loop/message_pump_io_ios_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/memory/weak_ptr_unittest.cc ('k') | base/message_loop/message_pump_libevent_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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_io_ios.h" 5 #include "base/message_loop/message_pump_io_ios.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 // Test to make sure that we catch calling WatchFileDescriptor off of the wrong 76 // Test to make sure that we catch calling WatchFileDescriptor off of the wrong
77 // thread. 77 // thread.
78 TEST_F(MessagePumpIOSForIOTest, TestWatchingFromBadThread) { 78 TEST_F(MessagePumpIOSForIOTest, TestWatchingFromBadThread) {
79 MessagePumpIOSForIO::FileDescriptorWatcher watcher; 79 MessagePumpIOSForIO::FileDescriptorWatcher watcher;
80 StupidWatcher delegate; 80 StupidWatcher delegate;
81 81
82 ASSERT_DCHECK_DEATH( 82 ASSERT_DCHECK_DEATH(
83 io_loop()->WatchFileDescriptor(STDOUT_FILENO, false, 83 io_loop()->WatchFileDescriptor(STDOUT_FILENO, false,
84 MessageLoopForIO::WATCH_READ, &watcher, 84 MessageLoopForIO::WATCH_READ, &watcher,
85 &delegate), 85 &delegate));
86 "Check failed: "
87 "watch_file_descriptor_caller_checker_.CalledOnValidThread\\(\\)");
88 } 86 }
89 87
90 class BaseWatcher : public MessagePumpIOSForIO::Watcher { 88 class BaseWatcher : public MessagePumpIOSForIO::Watcher {
91 public: 89 public:
92 BaseWatcher(MessagePumpIOSForIO::FileDescriptorWatcher* controller) 90 BaseWatcher(MessagePumpIOSForIO::FileDescriptorWatcher* controller)
93 : controller_(controller) { 91 : controller_(controller) {
94 DCHECK(controller_); 92 DCHECK(controller_);
95 } 93 }
96 ~BaseWatcher() override {} 94 ~BaseWatcher() override {}
97 95
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 pump->WatchFileDescriptor(pipefds_[1], 171 pump->WatchFileDescriptor(pipefds_[1],
174 false, MessagePumpIOSForIO::WATCH_READ_WRITE, &watcher, &delegate); 172 false, MessagePumpIOSForIO::WATCH_READ_WRITE, &watcher, &delegate);
175 173
176 // Spoof a callback. 174 // Spoof a callback.
177 HandleFdIOEvent(&watcher); 175 HandleFdIOEvent(&watcher);
178 } 176 }
179 177
180 } // namespace 178 } // namespace
181 179
182 } // namespace base 180 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/weak_ptr_unittest.cc ('k') | base/message_loop/message_pump_libevent_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698