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 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/location.h" |
8 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/single_thread_task_runner.h" |
| 11 #include "base/threading/thread_task_runner_handle.h" |
9 #include "content/browser/media/session/media_session.h" | 12 #include "content/browser/media/session/media_session.h" |
10 #include "content/browser/media/session/mock_media_session_observer.h" | 13 #include "content/browser/media/session/mock_media_session_observer.h" |
11 #include "content/public/test/content_browser_test.h" | 14 #include "content/public/test/content_browser_test.h" |
12 #include "content/shell/browser/shell.h" | 15 #include "content/shell/browser/shell.h" |
13 | 16 |
14 namespace content { | 17 namespace content { |
15 | 18 |
16 class MediaSessionDelegateAndroidBrowserTest : public ContentBrowserTest {}; | 19 class MediaSessionDelegateAndroidBrowserTest : public ContentBrowserTest {}; |
17 | 20 |
18 // MAYBE_OnAudioFocusChangeAfterDtorCrash will hit a DCHECK before the crash, it | 21 // MAYBE_OnAudioFocusChangeAfterDtorCrash will hit a DCHECK before the crash, it |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 MediaSession::Type::Content); | 53 MediaSession::Type::Content); |
51 EXPECT_TRUE(media_session->IsActive()); | 54 EXPECT_TRUE(media_session->IsActive()); |
52 EXPECT_TRUE(other_media_session->IsActive()); | 55 EXPECT_TRUE(other_media_session->IsActive()); |
53 | 56 |
54 shell()->CloseAllWindows(); | 57 shell()->CloseAllWindows(); |
55 | 58 |
56 // Give some time to the AudioFocusManager to send an audioFocusChange message | 59 // Give some time to the AudioFocusManager to send an audioFocusChange message |
57 // to the listeners. If the bug is still present, it will crash. | 60 // to the listeners. If the bug is still present, it will crash. |
58 { | 61 { |
59 base::RunLoop run_loop; | 62 base::RunLoop run_loop; |
60 base::MessageLoop::current()->PostDelayedTask( | 63 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
61 FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromSeconds(1)); | 64 FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromSeconds(1)); |
62 run_loop.Run(); | 65 run_loop.Run(); |
63 } | 66 } |
64 } | 67 } |
65 | 68 |
66 } // namespace content | 69 } // namespace content |
OLD | NEW |