| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 ArcSessionManager::Get()->RemoveObserver(this); | 77 ArcSessionManager::Get()->RemoveObserver(this); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void Wait() { | 80 void Wait() { |
| 81 run_loop_.reset(new base::RunLoop); | 81 run_loop_.reset(new base::RunLoop); |
| 82 run_loop_->Run(); | 82 run_loop_->Run(); |
| 83 run_loop_.reset(); | 83 run_loop_.reset(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 // ArcSessionManager::Observer: | 86 // ArcSessionManager::Observer: |
| 87 void OnShutdownBridge() override { | 87 void OnArcBridgeShutdown() override { |
| 88 if (!run_loop_) | 88 if (!run_loop_) |
| 89 return; | 89 return; |
| 90 run_loop_->Quit(); | 90 run_loop_->Quit(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 std::unique_ptr<base::RunLoop> run_loop_; | 94 std::unique_ptr<base::RunLoop> run_loop_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(ArcSessionManagerShutdownObserver); | 96 DISALLOW_COPY_AND_ASSIGN(ArcSessionManagerShutdownObserver); |
| 97 }; | 97 }; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 base::Time::Max()); | 263 base::Time::Max()); |
| 264 ArcSessionManagerShutdownObserver().Wait(); | 264 ArcSessionManagerShutdownObserver().Wait(); |
| 265 ASSERT_EQ(ArcSessionManager::State::REMOVING_DATA_DIR, | 265 ASSERT_EQ(ArcSessionManager::State::REMOVING_DATA_DIR, |
| 266 ArcSessionManager::Get()->state()); | 266 ArcSessionManager::Get()->state()); |
| 267 ArcSessionManagerDataRemovedObserver().Wait(); | 267 ArcSessionManagerDataRemovedObserver().Wait(); |
| 268 ASSERT_EQ(ArcSessionManager::State::STOPPED, | 268 ASSERT_EQ(ArcSessionManager::State::STOPPED, |
| 269 ArcSessionManager::Get()->state()); | 269 ArcSessionManager::Get()->state()); |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace arc | 272 } // namespace arc |
| OLD | NEW |