Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" | 7 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" |
| 8 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" | 8 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 GURL url(embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage)); | 76 GURL url(embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage)); |
| 77 ui_test_utils::NavigateToURL(browser(), url); | 77 ui_test_utils::NavigateToURL(browser(), url); |
| 78 content::WebContents* tab = | 78 content::WebContents* tab = |
| 79 browser()->tab_strip_model()->GetActiveWebContents(); | 79 browser()->tab_strip_model()->GetActiveWebContents(); |
| 80 | 80 |
| 81 if (!content::IsWebcamAvailableOnSystem(tab)) { | 81 if (!content::IsWebcamAvailableOnSystem(tab)) { |
| 82 DVLOG(0) << "No webcam found on bot: skipping..."; | 82 DVLOG(0) << "No webcam found on bot: skipping..."; |
| 83 return; | 83 return; |
| 84 } | 84 } |
| 85 | 85 |
| 86 // We have a Win8 bot failing at resolution "1280x720", which may or may not | |
| 87 // be due to its physical webcam not supporting that resolution. | |
| 88 // We disable those resolutions for Win8 until we find the root cause. | |
| 89 // See crbug.com/676041 | |
|
mcasas
2016/12/20 18:57:41
nit: can you rephrase this comment more TODO-ish p
chfremer
2016/12/20 19:11:00
Done.
| |
| 90 bool disable_720p_and_up = false; | |
| 91 #if defined(OS_WIN) | |
|
emircan
2016/12/20 18:57:28
Can you move this #if clause to 104 and return ins
chfremer
2016/12/20 19:11:00
Done.
| |
| 92 auto win_version = base::win::GetVersion(); | |
| 93 disable_720p_and_up = | |
| 94 (win_version == VERSION_WIN8 || win_version == VERSION_WIN8_1); | |
| 95 #endif | |
| 96 | |
| 86 EXPECT_EQ("320x240", | 97 EXPECT_EQ("320x240", |
| 87 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraintsQVGA)); | 98 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraintsQVGA)); |
| 88 EXPECT_EQ("640x480", | 99 EXPECT_EQ("640x480", |
| 89 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraintsVGA)); | 100 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraintsVGA)); |
| 90 EXPECT_EQ("640x360", | 101 EXPECT_EQ("640x360", |
| 91 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints360p)); | 102 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints360p)); |
| 103 | |
| 104 if (disable_720p_and_up) | |
| 105 return; | |
| 106 | |
| 92 EXPECT_EQ("1280x720", | 107 EXPECT_EQ("1280x720", |
| 93 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints720p)); | 108 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints720p)); |
| 94 EXPECT_EQ("1920x1080", | 109 EXPECT_EQ("1920x1080", |
| 95 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints1080p)); | 110 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints1080p)); |
| 96 } | 111 } |
| 97 | 112 |
| 98 INSTANTIATE_TEST_CASE_P(WebRtcWebcamBrowserTests, | 113 INSTANTIATE_TEST_CASE_P(WebRtcWebcamBrowserTests, |
| 99 WebRtcWebcamBrowserTest, | 114 WebRtcWebcamBrowserTest, |
| 100 testing::ValuesIn(kTestConfigFlags)); | 115 testing::ValuesIn(kTestConfigFlags)); |
| OLD | NEW |