| 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/native_desktop_media_list.h" | 5 #include "chrome/browser/media/native_desktop_media_list.h" |
| 6 | 6 |
| 7 #include "base/location.h" |
| 7 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/single_thread_task_runner.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 10 #include "chrome/browser/media/desktop_media_list_observer.h" | 12 #include "chrome/browser/media/desktop_media_list_observer.h" |
| 11 #include "content/public/test/test_browser_thread.h" | 13 #include "content/public/test/test_browser_thread.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 16 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
| 15 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | 17 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" |
| 16 #include "third_party/webrtc/modules/desktop_capture/window_capturer.h" | 18 #include "third_party/webrtc/modules/desktop_capture/window_capturer.h" |
| 17 | 19 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 base::Lock frame_values_lock_; | 126 base::Lock frame_values_lock_; |
| 125 | 127 |
| 126 DISALLOW_COPY_AND_ASSIGN(FakeWindowCapturer); | 128 DISALLOW_COPY_AND_ASSIGN(FakeWindowCapturer); |
| 127 }; | 129 }; |
| 128 | 130 |
| 129 ACTION_P2(CheckListSize, model, expected_list_size) { | 131 ACTION_P2(CheckListSize, model, expected_list_size) { |
| 130 EXPECT_EQ(expected_list_size, model->GetSourceCount()); | 132 EXPECT_EQ(expected_list_size, model->GetSourceCount()); |
| 131 } | 133 } |
| 132 | 134 |
| 133 ACTION_P(QuitMessageLoop, message_loop) { | 135 ACTION_P(QuitMessageLoop, message_loop) { |
| 134 message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); | 136 message_loop->task_runner()->PostTask(FROM_HERE, |
| 137 base::MessageLoop::QuitClosure()); |
| 135 } | 138 } |
| 136 | 139 |
| 137 class DesktopMediaListTest : public testing::Test { | 140 class DesktopMediaListTest : public testing::Test { |
| 138 public: | 141 public: |
| 139 DesktopMediaListTest() | 142 DesktopMediaListTest() |
| 140 : window_capturer_(NULL), | 143 : window_capturer_(NULL), |
| 141 ui_thread_(content::BrowserThread::UI, | 144 ui_thread_(content::BrowserThread::UI, |
| 142 &message_loop_) { | 145 &message_loop_) { |
| 143 } | 146 } |
| 144 | 147 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 // Swap the two windows. | 345 // Swap the two windows. |
| 343 webrtc::WindowCapturer::Window temp = list[0]; | 346 webrtc::WindowCapturer::Window temp = list[0]; |
| 344 list[0] = list[1]; | 347 list[0] = list[1]; |
| 345 list[1] = temp; | 348 list[1] = temp; |
| 346 window_capturer_->SetWindowList(list); | 349 window_capturer_->SetWindowList(list); |
| 347 | 350 |
| 348 message_loop_.Run(); | 351 message_loop_.Run(); |
| 349 } | 352 } |
| 350 | 353 |
| 351 } // namespace | 354 } // namespace |
| OLD | NEW |