| 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" |
| 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
| 14 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
| 15 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
| 16 #include "content/public/test/browser_test_utils.h" | 16 #include "content/public/test/browser_test_utils.h" |
| 17 #include "media/base/media_switches.h" | 17 #include "media/base/media_switches.h" |
| 18 #include "net/test/embedded_test_server/embedded_test_server.h" | 18 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 19 #include "testing/gtest/include/gtest/gtest-param-test.h" | 19 #include "testing/gtest/include/gtest/gtest-param-test.h" |
| 20 | 20 |
| 21 #if defined(OS_WIN) |
| 22 #include "base/win/windows_version.h" |
| 23 #endif |
| 24 |
| 21 static const char kMainWebrtcTestHtmlPage[] = | 25 static const char kMainWebrtcTestHtmlPage[] = |
| 22 "/webrtc/webrtc_jsep01_test.html"; | 26 "/webrtc/webrtc_jsep01_test.html"; |
| 23 | 27 |
| 24 static const char* kTestConfigFlags[] = { | 28 static const char* kTestConfigFlags[] = { |
| 25 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
| 26 NULL, | 30 NULL, |
| 27 // Media Foundation is only available in Windows versions >= 7, below that the | 31 // Media Foundation is only available in Windows versions >= 7, below that the |
| 28 // following flag has no effect; the test would run twice using DirectShow. | 32 // following flag has no effect; the test would run twice using DirectShow. |
| 29 switches::kForceMediaFoundationVideoCapture | 33 switches::kForceMediaFoundationVideoCapture |
| 30 #else | 34 #else |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 DVLOG(0) << "No webcam found on bot: skipping..."; | 86 DVLOG(0) << "No webcam found on bot: skipping..."; |
| 83 return; | 87 return; |
| 84 } | 88 } |
| 85 | 89 |
| 86 EXPECT_EQ("320x240", | 90 EXPECT_EQ("320x240", |
| 87 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraintsQVGA)); | 91 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraintsQVGA)); |
| 88 EXPECT_EQ("640x480", | 92 EXPECT_EQ("640x480", |
| 89 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraintsVGA)); | 93 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraintsVGA)); |
| 90 EXPECT_EQ("640x360", | 94 EXPECT_EQ("640x360", |
| 91 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints360p)); | 95 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints360p)); |
| 96 |
| 97 // TODO(chfremer): Reenable these tests when https://crbug.com/676041 is |
| 98 // resolved. |
| 99 #if defined(OS_WIN) |
| 100 auto win_version = base::win::GetVersion(); |
| 101 if (win_version == base::win::VERSION_WIN8 || |
| 102 win_version == base::win::VERSION_WIN8_1) { |
| 103 return; |
| 104 } |
| 105 #endif |
| 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 |