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

Side by Side Diff: third_party/mojo/src/mojo/edk/system/simple_dispatcher_unittest.cc

Issue 883843002: Update mojo sdk to rev 126532ce21c5c3c55a1e1693731411cb60169efd (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes to adapt to roll Created 5 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a 5 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a
6 // heavily-loaded system). Sorry. |test::EpsilonTimeout()| may be increased to 6 // heavily-loaded system). Sorry. |test::EpsilonTimeout()| may be increased to
7 // increase tolerance and reduce observed flakiness (though doing so reduces the 7 // increase tolerance and reduce observed flakiness (though doing so reduces the
8 // meaningfulness of the test). 8 // meaningfulness of the test).
9 9
10 #include "mojo/edk/system/simple_dispatcher.h" 10 #include "mojo/edk/system/simple_dispatcher.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 d->AddAwakable(&w, MOJO_HANDLE_SIGNAL_WRITABLE, 4, nullptr)); 318 d->AddAwakable(&w, MOJO_HANDLE_SIGNAL_WRITABLE, 4, nullptr));
319 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); 319 EXPECT_EQ(MOJO_RESULT_OK, d->Close());
320 stopwatch.Start(); 320 stopwatch.Start();
321 EXPECT_EQ(MOJO_RESULT_CANCELLED, 321 EXPECT_EQ(MOJO_RESULT_CANCELLED,
322 w.Wait(2 * test::EpsilonTimeout().InMicroseconds(), &context)); 322 w.Wait(2 * test::EpsilonTimeout().InMicroseconds(), &context));
323 EXPECT_LT(stopwatch.Elapsed(), test::EpsilonTimeout()); 323 EXPECT_LT(stopwatch.Elapsed(), test::EpsilonTimeout());
324 EXPECT_EQ(4u, context); 324 EXPECT_EQ(4u, context);
325 // Don't need to remove waiters from closed dispatchers. 325 // Don't need to remove waiters from closed dispatchers.
326 } 326 }
327 327
328 #if defined(OS_WIN)
328 // http://crbug.com/396393 329 // http://crbug.com/396393
329 TEST(SimpleDispatcherTest, DISABLED_BasicThreaded) { 330 #define MAYBE_BasicThreaded DISABLED_BasicThreaded
331 #else
332 #define MAYBE_BasicThreaded BasicThreaded
333 #endif
334 TEST(SimpleDispatcherTest, MAYBE_BasicThreaded) {
330 test::Stopwatch stopwatch; 335 test::Stopwatch stopwatch;
331 bool did_wait; 336 bool did_wait;
332 MojoResult result; 337 MojoResult result;
333 uint32_t context; 338 uint32_t context;
334 HandleSignalsState hss; 339 HandleSignalsState hss;
335 340
336 // Wait for readable (already readable). 341 // Wait for readable (already readable).
337 { 342 {
338 scoped_refptr<MockSimpleDispatcher> d(new MockSimpleDispatcher()); 343 scoped_refptr<MockSimpleDispatcher> d(new MockSimpleDispatcher());
339 { 344 {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 // Since we closed before joining, we can't say much about what each thread 600 // Since we closed before joining, we can't say much about what each thread
596 // saw as the state. 601 // saw as the state.
597 } 602 }
598 } 603 }
599 604
600 // TODO(vtl): Stress test? 605 // TODO(vtl): Stress test?
601 606
602 } // namespace 607 } // namespace
603 } // namespace system 608 } // namespace system
604 } // namespace mojo 609 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698