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/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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 } // namespace | 155 } // namespace |
156 | 156 |
157 // Flaky on Windows: http://crbug.com/301887 | 157 // Flaky on Windows: http://crbug.com/301887 |
158 #if defined(OS_WIN) | 158 #if defined(OS_WIN) |
159 #define MAYBE_ChooseDesktopMedia DISABLED_ChooseDesktopMedia | 159 #define MAYBE_ChooseDesktopMedia DISABLED_ChooseDesktopMedia |
160 #else | 160 #else |
161 #define MAYBE_ChooseDesktopMedia ChooseDesktopMedia | 161 #define MAYBE_ChooseDesktopMedia ChooseDesktopMedia |
162 #endif | 162 #endif |
163 IN_PROC_BROWSER_TEST_F(DesktopCaptureApiTest, MAYBE_ChooseDesktopMedia) { | 163 IN_PROC_BROWSER_TEST_F(DesktopCaptureApiTest, MAYBE_ChooseDesktopMedia) { |
164 // For tab and audio share, we need to turn on the flag, because the | 164 // For tabshare, we need to turn on the flag. |
165 // functionality is currently behind the flags. | |
166 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 165 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
167 extensions::switches::kEnableTabForDesktopShare); | 166 extensions::switches::kEnableTabForDesktopShare); |
168 base::CommandLine::ForCurrentProcess()->AppendSwitch( | |
169 extensions::switches::kEnableDesktopCaptureAudio); | |
170 | 167 |
171 // Each element in the following array corresponds to one test in | 168 // Each element in the following array corresponds to one test in |
172 // chrome/test/data/extensions/api_test/desktop_capture/test.js . | 169 // chrome/test/data/extensions/api_test/desktop_capture/test.js . |
173 TestFlags test_flags[] = { | 170 TestFlags test_flags[] = { |
174 // pickerUiCanceled() | 171 // pickerUiCanceled() |
175 {true, true, false, false, content::DesktopMediaID()}, | 172 {true, true, false, false, content::DesktopMediaID()}, |
176 // chooseMedia() | 173 // chooseMedia() |
177 {true, true, false, false, | 174 {true, true, false, false, |
178 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, | 175 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, |
179 content::DesktopMediaID::kNullId)}, | 176 content::DesktopMediaID::kNullId)}, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 EXPECT_TRUE(result); | 272 EXPECT_TRUE(result); |
276 EXPECT_TRUE(test_flags[2].picker_created); | 273 EXPECT_TRUE(test_flags[2].picker_created); |
277 EXPECT_FALSE(test_flags[2].picker_deleted); | 274 EXPECT_FALSE(test_flags[2].picker_deleted); |
278 | 275 |
279 web_contents->Close(); | 276 web_contents->Close(); |
280 destroyed_watcher.Wait(); | 277 destroyed_watcher.Wait(); |
281 EXPECT_TRUE(test_flags[2].picker_deleted); | 278 EXPECT_TRUE(test_flags[2].picker_deleted); |
282 } | 279 } |
283 | 280 |
284 } // namespace extensions | 281 } // namespace extensions |
OLD | NEW |