| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/media/webrtc/desktop_media_list_ash.h" | 5 #include "chrome/browser/media/webrtc/desktop_media_list_ash.h" |
| 6 | 6 |
| 7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 EXPECT_CALL(observer_, OnSourceAdded(list_.get(), 0)); | 97 EXPECT_CALL(observer_, OnSourceAdded(list_.get(), 0)); |
| 98 EXPECT_CALL(observer_, OnSourceThumbnailChanged(list_.get(), 0)) | 98 EXPECT_CALL(observer_, OnSourceThumbnailChanged(list_.get(), 0)) |
| 99 .WillOnce(QuitMessageLoop()) | 99 .WillOnce(QuitMessageLoop()) |
| 100 .WillRepeatedly(DoDefault()); | 100 .WillRepeatedly(DoDefault()); |
| 101 | 101 |
| 102 list_->StartUpdating(&observer_); | 102 list_->StartUpdating(&observer_); |
| 103 base::RunLoop().Run(); | 103 base::RunLoop().Run(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 // Times out on Win DrMemory bot. http://crbug.com/493187 | 106 TEST_F(DesktopMediaListAshTest, WindowOnly) { |
| 107 #if defined(OS_WIN) | |
| 108 #define MAYBE_WindowOnly DISABLED_WindowOnly | |
| 109 #else | |
| 110 #define MAYBE_WindowOnly WindowOnly | |
| 111 #endif | |
| 112 | |
| 113 TEST_F(DesktopMediaListAshTest, MAYBE_WindowOnly) { | |
| 114 CreateList(DesktopMediaListAsh::WINDOWS); | 107 CreateList(DesktopMediaListAsh::WINDOWS); |
| 115 | 108 |
| 116 std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0)); | 109 std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0)); |
| 117 | 110 |
| 118 EXPECT_CALL(observer_, OnSourceAdded(list_.get(), 0)); | 111 EXPECT_CALL(observer_, OnSourceAdded(list_.get(), 0)); |
| 119 EXPECT_CALL(observer_, OnSourceThumbnailChanged(list_.get(), 0)) | 112 EXPECT_CALL(observer_, OnSourceThumbnailChanged(list_.get(), 0)) |
| 120 .WillOnce(QuitMessageLoop()) | 113 .WillOnce(QuitMessageLoop()) |
| 121 .WillRepeatedly(DoDefault()); | 114 .WillRepeatedly(DoDefault()); |
| 122 EXPECT_CALL(observer_, OnSourceRemoved(list_.get(), 0)) | 115 EXPECT_CALL(observer_, OnSourceRemoved(list_.get(), 0)) |
| 123 .WillOnce(QuitMessageLoop()); | 116 .WillOnce(QuitMessageLoop()); |
| 124 | 117 |
| 125 list_->StartUpdating(&observer_); | 118 list_->StartUpdating(&observer_); |
| 126 base::RunLoop().Run(); | 119 base::RunLoop().Run(); |
| 127 window.reset(); | 120 window.reset(); |
| 128 base::RunLoop().Run(); | 121 base::RunLoop().Run(); |
| 129 } | 122 } |
| OLD | NEW |