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

Side by Side Diff: chrome/browser/chromeos/arc/arc_session_manager_browsertest.cc

Issue 2720303002: Do nothing on OnSessionStopped if ARC is being restarted. (Closed)
Patch Set: Get rid of ArcSessionObserver Created 3 years, 9 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 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/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 } // namespace 64 } // namespace
65 65
66 namespace arc { 66 namespace arc {
67 67
68 // Waits for the "arc.enabled" preference value from true to false. 68 // Waits for the "arc.enabled" preference value from true to false.
69 class ArcPlayStoreDisabledWaiter : public ArcSessionManager::Observer { 69 class ArcPlayStoreDisabledWaiter : public ArcSessionManager::Observer {
70 public: 70 public:
71 ArcPlayStoreDisabledWaiter() { ArcSessionManager::Get()->AddObserver(this); } 71 ArcPlayStoreDisabledWaiter() { ArcSessionManager::Get()->AddObserver(this); }
72 72
73 ~ArcPlayStoreDisabledWaiter() override { 73 ~ArcPlayStoreDisabledWaiter() {
74 ArcSessionManager::Get()->RemoveObserver(this); 74 ArcSessionManager::Get()->RemoveObserver(this);
75 } 75 }
76 76
77 void Wait() { 77 void Wait() {
78 base::RunLoop run_loop; 78 base::RunLoop run_loop;
79 base::AutoReset<base::RunLoop*> reset(&run_loop_, &run_loop); 79 base::AutoReset<base::RunLoop*> reset(&run_loop_, &run_loop);
80 run_loop.Run(); 80 run_loop.Run();
81 } 81 }
82 82
83 private: 83 private:
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 base::Time::Max()); 229 base::Time::Max());
230 ArcPlayStoreDisabledWaiter().Wait(); 230 ArcPlayStoreDisabledWaiter().Wait();
231 ASSERT_EQ(ArcSessionManager::State::REMOVING_DATA_DIR, 231 ASSERT_EQ(ArcSessionManager::State::REMOVING_DATA_DIR,
232 ArcSessionManager::Get()->state()); 232 ArcSessionManager::Get()->state());
233 ArcDataRemovedWaiter().Wait(); 233 ArcDataRemovedWaiter().Wait();
234 ASSERT_EQ(ArcSessionManager::State::STOPPED, 234 ASSERT_EQ(ArcSessionManager::State::STOPPED,
235 ArcSessionManager::Get()->state()); 235 ArcSessionManager::Get()->state());
236 } 236 }
237 237
238 } // namespace arc 238 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698