| 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 // Some test cases below are commented out because getUserMedia will fail |
| 211 // due to the fake source id currently. |
| 212 // TODO(braveyao): get these cases working again. http://crbug.com/699201 |
| 213 |
| 209 // tabShareWithAudioGetStream() | 214 // tabShareWithAudioGetStream() |
| 210 {false, false, true, true, | 215 //{false, false, true, true, |
| 211 content::DesktopMediaID(content::DesktopMediaID::TYPE_WEB_CONTENTS, 0, | 216 // content::DesktopMediaID(content::DesktopMediaID::TYPE_WEB_CONTENTS, 0, |
| 212 true)}, | 217 // true)}, |
| 213 // windowShareWithAudioGetStream() | 218 // windowShareWithAudioGetStream() |
| 214 {false, true, false, true, | 219 //{false, true, false, true, |
| 215 content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW, 0, true)}, | 220 //content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW, 0, true)}, |
| 216 // screenShareWithAudioGetStream() | 221 // screenShareWithAudioGetStream() |
| 217 {true, false, false, true, | 222 {true, false, false, true, |
| 218 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, | 223 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, |
| 219 webrtc::kFullDesktopScreenId, true)}, | 224 webrtc::kFullDesktopScreenId, true)}, |
| 220 // tabShareWithoutAudioGetStream() | 225 // tabShareWithoutAudioGetStream() |
| 221 {false, false, true, true, | 226 //{false, false, true, true, |
| 222 content::DesktopMediaID(content::DesktopMediaID::TYPE_WEB_CONTENTS, 0)}, | 227 //content::DesktopMediaID(content::DesktopMediaID::TYPE_WEB_CONTENTS, 0)}, |
| 223 // windowShareWithoutAudioGetStream() | 228 // windowShareWithoutAudioGetStream() |
| 224 {false, true, false, true, | 229 //{false, true, false, true, |
| 225 content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW, 0)}, | 230 // content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW, 0)}, |
| 226 // screenShareWithoutAudioGetStream() | 231 // screenShareWithoutAudioGetStream() |
| 227 {true, false, false, true, | 232 {true, false, false, true, |
| 228 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, | 233 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, |
| 229 webrtc::kFullDesktopScreenId)}, | 234 webrtc::kFullDesktopScreenId)}, |
| 230 }; | 235 }; |
| 231 picker_factory_.SetTestFlags(test_flags, arraysize(test_flags)); | 236 picker_factory_.SetTestFlags(test_flags, arraysize(test_flags)); |
| 232 ASSERT_TRUE(RunExtensionTest("desktop_capture")) << message_; | 237 ASSERT_TRUE(RunExtensionTest("desktop_capture")) << message_; |
| 233 } | 238 } |
| 234 | 239 |
| 235 // Test is flaky http://crbug.com/301887. | 240 // Test is flaky http://crbug.com/301887. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 EXPECT_TRUE(result); | 291 EXPECT_TRUE(result); |
| 287 EXPECT_TRUE(test_flags[2].picker_created); | 292 EXPECT_TRUE(test_flags[2].picker_created); |
| 288 EXPECT_FALSE(test_flags[2].picker_deleted); | 293 EXPECT_FALSE(test_flags[2].picker_deleted); |
| 289 | 294 |
| 290 web_contents->Close(); | 295 web_contents->Close(); |
| 291 destroyed_watcher.Wait(); | 296 destroyed_watcher.Wait(); |
| 292 EXPECT_TRUE(test_flags[2].picker_deleted); | 297 EXPECT_TRUE(test_flags[2].picker_deleted); |
| 293 } | 298 } |
| 294 | 299 |
| 295 } // namespace extensions | 300 } // namespace extensions |
| OLD | NEW |