| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 command_line->AppendSwitch(switches::kUseGpuInTests); | 59 command_line->AppendSwitch(switches::kUseGpuInTests); |
| 60 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 60 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 61 switches::kUseFakeDeviceForMediaStream); | 61 switches::kUseFakeDeviceForMediaStream); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void TearDown() override { | 64 void TearDown() override { |
| 65 // Kill any processes we may have brought up. Note: this isn't perfect, | 65 // Kill any processes we may have brought up. Note: this isn't perfect, |
| 66 // especially if the test hangs or if we're on Windows. | 66 // especially if the test hangs or if we're on Windows. |
| 67 LOG(INFO) << "Entering TearDown"; | 67 LOG(INFO) << "Entering TearDown"; |
| 68 if (dev_appserver_.IsValid()) | 68 if (dev_appserver_.IsValid()) |
| 69 base::KillProcess(dev_appserver_.Handle(), 0, false); | 69 dev_appserver_.Terminate(0, false); |
| 70 if (collider_server_.IsValid()) | 70 if (collider_server_.IsValid()) |
| 71 base::KillProcess(collider_server_.Handle(), 0, false); | 71 collider_server_.Terminate(0, false); |
| 72 if (firefox_.IsValid()) | 72 if (firefox_.IsValid()) |
| 73 base::KillProcess(firefox_.Handle(), 0, false); | 73 firefox_.Terminate(0, false); |
| 74 LOG(INFO) << "Exiting TearDown"; | 74 LOG(INFO) << "Exiting TearDown"; |
| 75 } | 75 } |
| 76 | 76 |
| 77 protected: | 77 protected: |
| 78 bool LaunchApprtcInstanceOnLocalhost(const std::string& port) { | 78 bool LaunchApprtcInstanceOnLocalhost(const std::string& port) { |
| 79 base::FilePath appengine_dev_appserver = | 79 base::FilePath appengine_dev_appserver = |
| 80 GetSourceDir().Append( | 80 GetSourceDir().Append( |
| 81 FILE_PATH_LITERAL("../google_appengine/dev_appserver.py")); | 81 FILE_PATH_LITERAL("../google_appengine/dev_appserver.py")); |
| 82 if (!base::PathExists(appengine_dev_appserver)) { | 82 if (!base::PathExists(appengine_dev_appserver)) { |
| 83 LOG(ERROR) << "Missing appengine sdk at " << | 83 LOG(ERROR) << "Missing appengine sdk at " << |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 "&firefox_fake_device=1"); | 286 "&firefox_fake_device=1"); |
| 287 content::WebContents* chrome_tab = OpenPageAndAcceptUserMedia(room_url); | 287 content::WebContents* chrome_tab = OpenPageAndAcceptUserMedia(room_url); |
| 288 | 288 |
| 289 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); | 289 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); |
| 290 | 290 |
| 291 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); | 291 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); |
| 292 | 292 |
| 293 // Ensure Firefox manages to send video our way. | 293 // Ensure Firefox manages to send video our way. |
| 294 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); | 294 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); |
| 295 } | 295 } |
| OLD | NEW |