| 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 "base/win/windows_version.h" | |
| 7 #include "chrome/browser/media/webrtc_browsertest_base.h" | 6 #include "chrome/browser/media/webrtc_browsertest_base.h" |
| 8 #include "chrome/browser/media/webrtc_browsertest_common.h" | 7 #include "chrome/browser/media/webrtc_browsertest_common.h" |
| 9 #include "chrome/common/chrome_version_info.h" | 8 #include "chrome/common/chrome_version_info.h" |
| 10 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
| 11 #include "media/base/media_switches.h" | 10 #include "media/base/media_switches.h" |
| 12 #include "net/test/embedded_test_server/embedded_test_server.h" | 11 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 13 | 12 |
| 14 static const char kMainWebrtcTestHtmlPage[] = | 13 static const char kMainWebrtcTestHtmlPage[] = |
| 15 "/webrtc/webrtc_jsep01_test.html"; | 14 "/webrtc/webrtc_jsep01_test.html"; |
| 16 | 15 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 44 command_line->AppendSwitch(switches::kDisableWebRtcEncryption); | 43 command_line->AppendSwitch(switches::kDisableWebRtcEncryption); |
| 45 } | 44 } |
| 46 | 45 |
| 47 private: | 46 private: |
| 48 DISALLOW_COPY_AND_ASSIGN(WebRtcDisableEncryptionFlagBrowserTest); | 47 DISALLOW_COPY_AND_ASSIGN(WebRtcDisableEncryptionFlagBrowserTest); |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 // Makes a call and checks that there's encryption or not in the SDP offer. | 50 // Makes a call and checks that there's encryption or not in the SDP offer. |
| 52 IN_PROC_BROWSER_TEST_F(WebRtcDisableEncryptionFlagBrowserTest, | 51 IN_PROC_BROWSER_TEST_F(WebRtcDisableEncryptionFlagBrowserTest, |
| 53 VerifyEncryption) { | 52 VerifyEncryption) { |
| 54 // Flaky timeout on a webrtc Win XP bot. http://crbug.com/368163. | 53 if (!OnWinXp()) |
| 55 #if defined (OS_WIN) | 54 return; // Flaky timeout on a webrtc Win XP bot. http://crbug.com/368163. |
| 56 if (base::win::GetVersion() < base::win::VERSION_VISTA) | |
| 57 return; | |
| 58 #endif | |
| 59 | 55 |
| 60 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 56 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 61 | 57 |
| 62 content::WebContents* left_tab = | 58 content::WebContents* left_tab = |
| 63 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 59 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 64 content::WebContents* right_tab = | 60 content::WebContents* right_tab = |
| 65 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 61 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 66 | 62 |
| 67 SetupPeerconnectionWithLocalStream(left_tab); | 63 SetupPeerconnectionWithLocalStream(left_tab); |
| 68 SetupPeerconnectionWithLocalStream(right_tab); | 64 SetupPeerconnectionWithLocalStream(right_tab); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 87 should_detect_encryption = false; | 83 should_detect_encryption = false; |
| 88 #endif | 84 #endif |
| 89 | 85 |
| 90 std::string expected_string = should_detect_encryption ? | 86 std::string expected_string = should_detect_encryption ? |
| 91 "crypto-seen" : "no-crypto-seen"; | 87 "crypto-seen" : "no-crypto-seen"; |
| 92 | 88 |
| 93 ASSERT_EQ(expected_string, | 89 ASSERT_EQ(expected_string, |
| 94 ExecuteJavascript("hasSeenCryptoInSdp()", left_tab)); | 90 ExecuteJavascript("hasSeenCryptoInSdp()", left_tab)); |
| 95 | 91 |
| 96 HangUp(left_tab); | 92 HangUp(left_tab); |
| 93 HangUp(right_tab); |
| 97 } | 94 } |
| OLD | NEW |