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

Side by Side Diff: mojo/edk/system/wait_set_dispatcher_unittest.cc

Issue 1958823002: Fix implicit access to raw pointer of scoped_refptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Splitting out change to scoped_refptr to follow up patch. Created 4 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
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher.cc ('k') | net/proxy/proxy_script_decider_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mojo/edk/system/wait_set_dispatcher.h" 5 #include "mojo/edk/system/wait_set_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 uint32_t num_bytes = sizeof(read_buffer); 229 uint32_t num_bytes = sizeof(read_buffer);
230 ReadMessage(dispatcher0_.get(), read_buffer, &num_bytes); 230 ReadMessage(dispatcher0_.get(), read_buffer, &num_bytes);
231 EXPECT_EQ(sizeof(buffer), num_bytes); 231 EXPECT_EQ(sizeof(buffer), num_bytes);
232 232
233 // No dispatchers are ready. 233 // No dispatchers are ready.
234 w.Init(); 234 w.Init();
235 woken_dispatcher = nullptr; 235 woken_dispatcher = nullptr;
236 context = 0; 236 context = 0;
237 EXPECT_EQ(MOJO_RESULT_SHOULD_WAIT, 237 EXPECT_EQ(MOJO_RESULT_SHOULD_WAIT,
238 GetOneReadyDispatcher(wait_set, &woken_dispatcher, &context)); 238 GetOneReadyDispatcher(wait_set, &woken_dispatcher, &context));
239 EXPECT_EQ(nullptr, woken_dispatcher); 239 EXPECT_FALSE(woken_dispatcher);
240 EXPECT_EQ(0u, context); 240 EXPECT_EQ(0u, context);
241 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, w.Wait(0, nullptr)); 241 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, w.Wait(0, nullptr));
242 } 242 }
243 243
244 wait_set->RemoveAwakable(&w, nullptr); 244 wait_set->RemoveAwakable(&w, nullptr);
245 } 245 }
246 246
247 TEST_F(WaitSetDispatcherTest, MultipleReady) { 247 TEST_F(WaitSetDispatcherTest, MultipleReady) {
248 scoped_refptr<WaitSetDispatcher> wait_set = new WaitSetDispatcher(); 248 scoped_refptr<WaitSetDispatcher> wait_set = new WaitSetDispatcher();
249 CloseOnShutdown(wait_set); 249 CloseOnShutdown(wait_set);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 EXPECT_EQ(MOJO_RESULT_OK, 484 EXPECT_EQ(MOJO_RESULT_OK,
485 GetOneReadyDispatcher(wait_set, &woken_dispatcher, nullptr)); 485 GetOneReadyDispatcher(wait_set, &woken_dispatcher, nullptr));
486 EXPECT_EQ(nested_wait_set, woken_dispatcher); 486 EXPECT_EQ(nested_wait_set, woken_dispatcher);
487 487
488 wait_set->RemoveAwakable(&w, nullptr); 488 wait_set->RemoveAwakable(&w, nullptr);
489 } 489 }
490 490
491 } // namespace 491 } // namespace
492 } // namespace edk 492 } // namespace edk
493 } // namespace mojo 493 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher.cc ('k') | net/proxy/proxy_script_decider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698