| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 notify_finish_.Run(); | 326 notify_finish_.Run(); |
| 327 } | 327 } |
| 328 | 328 |
| 329 private: | 329 private: |
| 330 base::Lock lock_; | 330 base::Lock lock_; |
| 331 const size_t total_count_; | 331 const size_t total_count_; |
| 332 size_t current_count_; | 332 size_t current_count_; |
| 333 base::Closure notify_finish_; | 333 base::Closure notify_finish_; |
| 334 }; | 334 }; |
| 335 | 335 |
| 336 TEST_F(AssociatedInterfaceTest, MultiThreadAccess) { | 336 // Disabled due to flakes on Windows bots. See crbug.com/615450. |
| 337 TEST_F(AssociatedInterfaceTest, DISABLED_MultiThreadAccess) { |
| 337 // Set up four associated interfaces on a message pipe. Use the inteface | 338 // Set up four associated interfaces on a message pipe. Use the inteface |
| 338 // pointers on four threads in parallel; run the interface implementations on | 339 // pointers on four threads in parallel; run the interface implementations on |
| 339 // two threads. Test that multi-threaded access works. | 340 // two threads. Test that multi-threaded access works. |
| 340 | 341 |
| 341 const int32_t kMaxValue = 1000; | 342 const int32_t kMaxValue = 1000; |
| 342 MessagePipe pipe; | 343 MessagePipe pipe; |
| 343 scoped_refptr<MultiplexRouter> router0(new MultiplexRouter( | 344 scoped_refptr<MultiplexRouter> router0(new MultiplexRouter( |
| 344 true, std::move(pipe.handle0), base::ThreadTaskRunnerHandle::Get())); | 345 true, std::move(pipe.handle0), base::ThreadTaskRunnerHandle::Get())); |
| 345 scoped_refptr<MultiplexRouter> router1(new MultiplexRouter( | 346 scoped_refptr<MultiplexRouter> router1(new MultiplexRouter( |
| 346 false, std::move(pipe.handle1), base::ThreadTaskRunnerHandle::Get())); | 347 false, std::move(pipe.handle1), base::ThreadTaskRunnerHandle::Get())); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 | 558 |
| 558 // The previous wait has dispatched the GetSender request message, therefore | 559 // The previous wait has dispatched the GetSender request message, therefore |
| 559 // an associated interface has been set up on the pipe. It is not allowed to | 560 // an associated interface has been set up on the pipe. It is not allowed to |
| 560 // wait or pause. | 561 // wait or pause. |
| 561 EXPECT_TRUE(connection.binding()->HasAssociatedInterfaces()); | 562 EXPECT_TRUE(connection.binding()->HasAssociatedInterfaces()); |
| 562 } | 563 } |
| 563 | 564 |
| 564 } // namespace | 565 } // namespace |
| 565 } // namespace test | 566 } // namespace test |
| 566 } // namespace mojo | 567 } // namespace mojo |
| OLD | NEW |