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 <queue> | 5 #include <queue> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h" | 10 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // DesktopCaptureChooseDesktopMediaFunction::PickerFactory interface. | 77 // DesktopCaptureChooseDesktopMediaFunction::PickerFactory interface. |
78 virtual scoped_ptr<DesktopMediaPickerModel> CreateModel( | 78 virtual scoped_ptr<DesktopMediaPickerModel> CreateModel( |
79 scoped_ptr<webrtc::ScreenCapturer> screen_capturer, | 79 scoped_ptr<webrtc::ScreenCapturer> screen_capturer, |
80 scoped_ptr<webrtc::WindowCapturer> window_capturer) OVERRIDE { | 80 scoped_ptr<webrtc::WindowCapturer> window_capturer) OVERRIDE { |
81 EXPECT_TRUE(!expectations_.empty()); | 81 EXPECT_TRUE(!expectations_.empty()); |
82 if (!expectations_.empty()) { | 82 if (!expectations_.empty()) { |
83 EXPECT_EQ(expectations_.front().screens, !!screen_capturer.get()); | 83 EXPECT_EQ(expectations_.front().screens, !!screen_capturer.get()); |
84 EXPECT_EQ(expectations_.front().windows, !!window_capturer.get()); | 84 EXPECT_EQ(expectations_.front().windows, !!window_capturer.get()); |
85 } | 85 } |
86 return scoped_ptr<DesktopMediaPickerModel>( | 86 return scoped_ptr<DesktopMediaPickerModel>( |
87 new DesktopMediaPickerModel(screen_capturer.Pass(), | 87 new DesktopMediaPickerModelImpl(screen_capturer.Pass(), |
88 window_capturer.Pass())); | 88 window_capturer.Pass())); |
89 } | 89 } |
90 virtual scoped_ptr<DesktopMediaPicker> CreatePicker() OVERRIDE { | 90 virtual scoped_ptr<DesktopMediaPicker> CreatePicker() OVERRIDE { |
91 content::DesktopMediaID next_source; | 91 content::DesktopMediaID next_source; |
92 if (!expectations_.empty()) { | 92 if (!expectations_.empty()) { |
93 next_source = expectations_.front().selected_source; | 93 next_source = expectations_.front().selected_source; |
94 expectations_.pop(); | 94 expectations_.pop(); |
95 } | 95 } |
96 return scoped_ptr<DesktopMediaPicker>( | 96 return scoped_ptr<DesktopMediaPicker>( |
97 new FakeDesktopMediaPicker(next_source)); | 97 new FakeDesktopMediaPicker(next_source)); |
98 } | 98 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 "getStream()", &result)); | 191 "getStream()", &result)); |
192 EXPECT_TRUE(result); | 192 EXPECT_TRUE(result); |
193 | 193 |
194 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 194 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
195 browser()->tab_strip_model()->GetActiveWebContents(), | 195 browser()->tab_strip_model()->GetActiveWebContents(), |
196 "getStreamWithInvalidId()", &result)); | 196 "getStreamWithInvalidId()", &result)); |
197 EXPECT_TRUE(result); | 197 EXPECT_TRUE(result); |
198 } | 198 } |
199 | 199 |
200 } // namespace extensions | 200 } // namespace extensions |
OLD | NEW |