OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "net/base/address_tracker_linux.h" | 5 #include "net/base/address_tracker_linux.h" |
6 | 6 |
7 #include <linux/if.h> | 7 #include <linux/if.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 | 684 |
685 TEST_F(AddressTrackerLinuxTest, NonTrackingModeInit) { | 685 TEST_F(AddressTrackerLinuxTest, NonTrackingModeInit) { |
686 AddressTrackerLinux tracker; | 686 AddressTrackerLinux tracker; |
687 tracker.Init(); | 687 tracker.Init(); |
688 } | 688 } |
689 | 689 |
690 class GetCurrentConnectionTypeRunner | 690 class GetCurrentConnectionTypeRunner |
691 : public base::DelegateSimpleThread::Delegate { | 691 : public base::DelegateSimpleThread::Delegate { |
692 public: | 692 public: |
693 explicit GetCurrentConnectionTypeRunner(AddressTrackerLinux* tracker, | 693 explicit GetCurrentConnectionTypeRunner(AddressTrackerLinux* tracker, |
694 const std::string& thread_name) | 694 const std::string& thread_name) |
695 : tracker_(tracker), done_(true, false), thread_(this, thread_name) { | 695 : tracker_(tracker), |
696 } | 696 done_(base::WaitableEvent::ResetPolicy::MANUAL, |
| 697 base::WaitableEvent::InitialState::NOT_SIGNALED), |
| 698 thread_(this, thread_name) {} |
697 ~GetCurrentConnectionTypeRunner() override {} | 699 ~GetCurrentConnectionTypeRunner() override {} |
698 | 700 |
699 void Run() override { | 701 void Run() override { |
700 tracker_->GetCurrentConnectionType(); | 702 tracker_->GetCurrentConnectionType(); |
701 done_.Signal(); | 703 done_.Signal(); |
702 } | 704 } |
703 | 705 |
704 void Start() { | 706 void Start() { |
705 thread_.Start(); | 707 thread_.Start(); |
706 } | 708 } |
(...skipping 24 matching lines...) Expand all Loading... |
731 tracker_->Init(); | 733 tracker_->Init(); |
732 | 734 |
733 runner1.VerifyCompletes(); | 735 runner1.VerifyCompletes(); |
734 runner2.VerifyCompletes(); | 736 runner2.VerifyCompletes(); |
735 } | 737 } |
736 | 738 |
737 } // namespace | 739 } // namespace |
738 | 740 |
739 } // namespace internal | 741 } // namespace internal |
740 } // namespace net | 742 } // namespace net |
OLD | NEW |