| OLD | NEW |
| 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" |
| 11 | 11 |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "mojo/edk/system/test/sleep.h" | 16 #include "mojo/edk/system/test/sleep.h" |
| 17 #include "mojo/edk/system/test/stopwatch.h" | 17 #include "mojo/edk/system/test/stopwatch.h" |
| 18 #include "mojo/edk/system/test/timeouts.h" | 18 #include "mojo/edk/system/test/timeouts.h" |
| 19 #include "mojo/edk/system/thread_annotations.h" | |
| 20 #include "mojo/edk/system/waiter.h" | 19 #include "mojo/edk/system/waiter.h" |
| 21 #include "mojo/edk/system/waiter_test_utils.h" | 20 #include "mojo/edk/system/waiter_test_utils.h" |
| 22 #include "mojo/edk/util/make_unique.h" | 21 #include "mojo/edk/util/make_unique.h" |
| 23 #include "mojo/edk/util/ref_ptr.h" | 22 #include "mojo/edk/util/ref_ptr.h" |
| 23 #include "mojo/edk/util/thread_annotations.h" |
| 24 #include "mojo/public/cpp/system/macros.h" | 24 #include "mojo/public/cpp/system/macros.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 26 |
| 27 using mojo::util::MakeRefCounted; | 27 using mojo::util::MakeRefCounted; |
| 28 using mojo::util::MutexLocker; |
| 28 using mojo::util::RefPtr; | 29 using mojo::util::RefPtr; |
| 29 | 30 |
| 30 namespace mojo { | 31 namespace mojo { |
| 31 namespace system { | 32 namespace system { |
| 32 namespace { | 33 namespace { |
| 33 | 34 |
| 34 class MockSimpleDispatcher final : public SimpleDispatcher { | 35 class MockSimpleDispatcher final : public SimpleDispatcher { |
| 35 public: | 36 public: |
| 36 // Note: Use |MakeRefCounted<MockSimpleDispatcher>()|. | 37 // Note: Use |MakeRefCounted<MockSimpleDispatcher>()|. |
| 37 | 38 |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 // Since we closed before joining, we can't say much about what each thread | 587 // Since we closed before joining, we can't say much about what each thread |
| 587 // saw as the state. | 588 // saw as the state. |
| 588 } | 589 } |
| 589 } | 590 } |
| 590 | 591 |
| 591 // TODO(vtl): Stress test? | 592 // TODO(vtl): Stress test? |
| 592 | 593 |
| 593 } // namespace | 594 } // namespace |
| 594 } // namespace system | 595 } // namespace system |
| 595 } // namespace mojo | 596 } // namespace mojo |
| OLD | NEW |