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 "chrome/browser/media/webrtc_browsertest_base.h" | 6 #include "chrome/browser/media/webrtc_browsertest_base.h" |
7 #include "chrome/browser/media/webrtc_browsertest_common.h" | 7 #include "chrome/browser/media/webrtc_browsertest_common.h" |
8 #include "chrome/common/chrome_version_info.h" | 8 #include "chrome/common/chrome_version_info.h" |
9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
10 #include "net/test/embedded_test_server/embedded_test_server.h" | 10 #include "net/test/embedded_test_server/embedded_test_server.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // detected until a branch has been promoted to another channel. The unit | 24 // detected until a branch has been promoted to another channel. The unit |
25 // test for ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch | 25 // test for ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch |
26 // tests for all channels however. | 26 // tests for all channels however. |
27 // TODO(grunell): Test the different channel cases for any build. | 27 // TODO(grunell): Test the different channel cases for any build. |
28 class WebRtcDisableEncryptionFlagBrowserTest : public WebRtcTestBase { | 28 class WebRtcDisableEncryptionFlagBrowserTest : public WebRtcTestBase { |
29 public: | 29 public: |
30 WebRtcDisableEncryptionFlagBrowserTest() {} | 30 WebRtcDisableEncryptionFlagBrowserTest() {} |
31 virtual ~WebRtcDisableEncryptionFlagBrowserTest() {} | 31 virtual ~WebRtcDisableEncryptionFlagBrowserTest() {} |
32 | 32 |
33 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 33 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
34 test::PeerConnectionServerRunner::KillAllPeerConnectionServers(); | 34 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); |
35 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. | 35 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. |
36 } | 36 } |
37 | 37 |
38 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 38 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
39 // This test should run with fake devices. | 39 // This test should run with fake devices. |
40 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); | 40 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); |
41 | 41 |
42 // Disable encryption with the command line flag. | 42 // Disable encryption with the command line flag. |
43 command_line->AppendSwitch(switches::kDisableWebRtcEncryption); | 43 command_line->AppendSwitch(switches::kDisableWebRtcEncryption); |
44 } | 44 } |
45 | 45 |
46 protected: | 46 protected: |
47 test::PeerConnectionServerRunner peerconnection_server_; | 47 PeerConnectionServerRunner peerconnection_server_; |
48 | 48 |
49 private: | 49 private: |
50 DISALLOW_COPY_AND_ASSIGN(WebRtcDisableEncryptionFlagBrowserTest); | 50 DISALLOW_COPY_AND_ASSIGN(WebRtcDisableEncryptionFlagBrowserTest); |
51 }; | 51 }; |
52 | 52 |
53 // Makes a call and checks that there's encryption or not in the SDP offer. | 53 // Makes a call and checks that there's encryption or not in the SDP offer. |
54 IN_PROC_BROWSER_TEST_F(WebRtcDisableEncryptionFlagBrowserTest, | 54 IN_PROC_BROWSER_TEST_F(WebRtcDisableEncryptionFlagBrowserTest, |
55 VerifyEncryption) { | 55 VerifyEncryption) { |
56 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 56 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
57 ASSERT_TRUE(peerconnection_server_.Start()); | 57 ASSERT_TRUE(peerconnection_server_.Start()); |
(...skipping 28 matching lines...) Expand all Loading... |
86 | 86 |
87 ASSERT_EQ(expected_string, | 87 ASSERT_EQ(expected_string, |
88 ExecuteJavascript("hasSeenCryptoInSdp()", left_tab)); | 88 ExecuteJavascript("hasSeenCryptoInSdp()", left_tab)); |
89 | 89 |
90 HangUp(left_tab); | 90 HangUp(left_tab); |
91 WaitUntilHangupVerified(left_tab); | 91 WaitUntilHangupVerified(left_tab); |
92 WaitUntilHangupVerified(right_tab); | 92 WaitUntilHangupVerified(right_tab); |
93 | 93 |
94 ASSERT_TRUE(peerconnection_server_.Stop()); | 94 ASSERT_TRUE(peerconnection_server_.Stop()); |
95 } | 95 } |
OLD | NEW |