Chromium Code Reviews| 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 <array> | 5 #include <array> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 // chooseMediaAndGetStream() | 199 // chooseMediaAndGetStream() |
| 200 {true, true, false, false, | 200 {true, true, false, false, |
| 201 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, | 201 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, |
| 202 webrtc::kFullDesktopScreenId)}, | 202 webrtc::kFullDesktopScreenId)}, |
| 203 // chooseMediaAndTryGetStreamWithInvalidId() | 203 // chooseMediaAndTryGetStreamWithInvalidId() |
| 204 {true, true, false, false, | 204 {true, true, false, false, |
| 205 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, | 205 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, |
| 206 webrtc::kFullDesktopScreenId)}, | 206 webrtc::kFullDesktopScreenId)}, |
| 207 // cancelDialog() | 207 // cancelDialog() |
| 208 {true, true, false, false, content::DesktopMediaID(), true}, | 208 {true, true, false, false, content::DesktopMediaID(), true}, |
| 209 | |
| 210 // screenShareWithAudioGetStream() | |
| 211 {true, false, false, true, | |
| 212 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, | |
| 213 webrtc::kFullDesktopScreenId, true)}, | |
| 214 | |
| 215 // screenShareWithoutAudioGetStream() | |
| 216 {true, false, false, true, | |
| 217 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, | |
| 218 webrtc::kFullDesktopScreenId)}, | |
| 219 | |
| 220 /** | |
|
Sergey Ulanov
2017/03/14 19:43:34
please use C++ style comments (//..) to comment th
braveyao
2017/03/14 23:42:08
Done.
| |
| 221 * Below test cases are commented out because getUserMedia will fail due | |
| 222 * to the fake source id currently. | |
| 223 * TODO(braveyao): get these cases working again. http://crbug.com/699201 | |
| 209 // tabShareWithAudioGetStream() | 224 // tabShareWithAudioGetStream() |
| 210 {false, false, true, true, | 225 {false, false, true, true, |
| 211 content::DesktopMediaID(content::DesktopMediaID::TYPE_WEB_CONTENTS, 0, | 226 content::DesktopMediaID(content::DesktopMediaID::TYPE_WEB_CONTENTS, 0, |
| 212 true)}, | 227 true)}, |
| 213 // windowShareWithAudioGetStream() | 228 // windowShareWithAudioGetStream() |
| 214 {false, true, false, true, | 229 {false, true, false, true, |
| 215 content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW, 0, true)}, | 230 content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW, 0, true)}, |
| 216 // screenShareWithAudioGetStream() | |
| 217 {true, false, false, true, | |
| 218 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, | |
| 219 webrtc::kFullDesktopScreenId, true)}, | |
| 220 // tabShareWithoutAudioGetStream() | 231 // tabShareWithoutAudioGetStream() |
| 221 {false, false, true, true, | 232 {false, false, true, true, |
| 222 content::DesktopMediaID(content::DesktopMediaID::TYPE_WEB_CONTENTS, 0)}, | 233 content::DesktopMediaID(content::DesktopMediaID::TYPE_WEB_CONTENTS, 0)}, |
| 223 // windowShareWithoutAudioGetStream() | 234 // windowShareWithoutAudioGetStream() |
| 224 {false, true, false, true, | 235 {false, true, false, true, |
| 225 content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW, 0)}, | 236 content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW, 0)}, |
| 226 // screenShareWithoutAudioGetStream() | 237 **/ |
| 227 {true, false, false, true, | |
| 228 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, | |
| 229 webrtc::kFullDesktopScreenId)}, | |
| 230 }; | 238 }; |
| 231 picker_factory_.SetTestFlags(test_flags, arraysize(test_flags)); | 239 picker_factory_.SetTestFlags(test_flags, arraysize(test_flags)); |
| 232 ASSERT_TRUE(RunExtensionTest("desktop_capture")) << message_; | 240 ASSERT_TRUE(RunExtensionTest("desktop_capture")) << message_; |
| 233 } | 241 } |
| 234 | 242 |
| 235 // Test is flaky http://crbug.com/301887. | 243 // Test is flaky http://crbug.com/301887. |
| 236 IN_PROC_BROWSER_TEST_F(DesktopCaptureApiTest, DISABLED_Delegation) { | 244 IN_PROC_BROWSER_TEST_F(DesktopCaptureApiTest, DISABLED_Delegation) { |
| 237 // Initialize test server. | 245 // Initialize test server. |
| 238 base::FilePath test_data; | 246 base::FilePath test_data; |
| 239 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data)); | 247 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data)); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 EXPECT_TRUE(result); | 294 EXPECT_TRUE(result); |
| 287 EXPECT_TRUE(test_flags[2].picker_created); | 295 EXPECT_TRUE(test_flags[2].picker_created); |
| 288 EXPECT_FALSE(test_flags[2].picker_deleted); | 296 EXPECT_FALSE(test_flags[2].picker_deleted); |
| 289 | 297 |
| 290 web_contents->Close(); | 298 web_contents->Close(); |
| 291 destroyed_watcher.Wait(); | 299 destroyed_watcher.Wait(); |
| 292 EXPECT_TRUE(test_flags[2].picker_deleted); | 300 EXPECT_TRUE(test_flags[2].picker_deleted); |
| 293 } | 301 } |
| 294 | 302 |
| 295 } // namespace extensions | 303 } // namespace extensions |
| OLD | NEW |