| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_enumerator.h" | 6 #include "base/files/file_enumerator.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/process/launch.h" | 8 #include "base/process/launch.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // | 41 // |
| 42 // This test will bring up a AppRTC instance on localhost and verify that the | 42 // This test will bring up a AppRTC instance on localhost and verify that the |
| 43 // call gets up when connecting to the same room from two tabs in a browser. | 43 // call gets up when connecting to the same room from two tabs in a browser. |
| 44 class WebRtcApprtcBrowserTest : public WebRtcTestBase { | 44 class WebRtcApprtcBrowserTest : public WebRtcTestBase { |
| 45 public: | 45 public: |
| 46 WebRtcApprtcBrowserTest() | 46 WebRtcApprtcBrowserTest() |
| 47 : dev_appserver_(base::kNullProcessHandle), | 47 : dev_appserver_(base::kNullProcessHandle), |
| 48 firefox_(base::kNullProcessHandle) { | 48 firefox_(base::kNullProcessHandle) { |
| 49 } | 49 } |
| 50 | 50 |
| 51 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 51 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 52 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)); | 52 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)); |
| 53 | 53 |
| 54 // The video playback will not work without a GPU, so force its use here. | 54 // The video playback will not work without a GPU, so force its use here. |
| 55 command_line->AppendSwitch(switches::kUseGpuInTests); | 55 command_line->AppendSwitch(switches::kUseGpuInTests); |
| 56 CommandLine::ForCurrentProcess()->AppendSwitch( | 56 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 57 switches::kUseFakeDeviceForMediaStream); | 57 switches::kUseFakeDeviceForMediaStream); |
| 58 } | 58 } |
| 59 | 59 |
| 60 virtual void TearDown() OVERRIDE { | 60 virtual void TearDown() override { |
| 61 // Kill any processes we may have brought up. | 61 // Kill any processes we may have brought up. |
| 62 LOG(INFO) << "Entering TearDown"; | 62 LOG(INFO) << "Entering TearDown"; |
| 63 if (dev_appserver_ != base::kNullProcessHandle) | 63 if (dev_appserver_ != base::kNullProcessHandle) |
| 64 base::KillProcess(dev_appserver_, 0, false); | 64 base::KillProcess(dev_appserver_, 0, false); |
| 65 // TODO(phoglund): Find some way to shut down Firefox cleanly on Windows. | 65 // TODO(phoglund): Find some way to shut down Firefox cleanly on Windows. |
| 66 if (firefox_ != base::kNullProcessHandle) | 66 if (firefox_ != base::kNullProcessHandle) |
| 67 base::KillProcess(firefox_, 0, false); | 67 base::KillProcess(firefox_, 0, false); |
| 68 LOG(INFO) << "Exiting TearDown"; | 68 LOG(INFO) << "Exiting TearDown"; |
| 69 } | 69 } |
| 70 | 70 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 base::RandInt(0, 65536))); | 282 base::RandInt(0, 65536))); |
| 283 content::WebContents* chrome_tab = OpenPageAndAcceptUserMedia(room_url); | 283 content::WebContents* chrome_tab = OpenPageAndAcceptUserMedia(room_url); |
| 284 | 284 |
| 285 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); | 285 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); |
| 286 | 286 |
| 287 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); | 287 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); |
| 288 | 288 |
| 289 // Ensure Firefox manages to send video our way. | 289 // Ensure Firefox manages to send video our way. |
| 290 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); | 290 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); |
| 291 } | 291 } |
| OLD | NEW |