OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/test/automation/proxy_launcher.h" | 5 #include "chrome/test/automation/proxy_launcher.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
12 #include "base/string_split.h" | 12 #include "base/string_split.h" |
13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
14 #include "base/test/test_file_util.h" | 14 #include "base/test/test_file_util.h" |
15 #include "base/test/test_timeouts.h" | 15 #include "base/test/test_timeouts.h" |
16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
17 #include "chrome/app/chrome_command_ids.h" | 17 #include "chrome/app/chrome_command_ids.h" |
18 #include "chrome/common/automation_constants.h" | 18 #include "chrome/common/automation_constants.h" |
19 #include "chrome/common/chrome_constants.h" | 19 #include "chrome/common/chrome_constants.h" |
20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/common/logging_chrome.h" | 21 #include "chrome/common/logging_chrome.h" |
22 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
23 #include "chrome/test/automation/automation_proxy.h" | 23 #include "chrome/test/automation/automation_proxy.h" |
24 #include "chrome/test/base/chrome_process_util.h" | 24 #include "chrome/test/base/chrome_process_util.h" |
25 #include "chrome/test/base/test_launcher_utils.h" | 25 #include "chrome/test/base/test_launcher_utils.h" |
26 #include "chrome/test/base/test_switches.h" | 26 #include "chrome/test/base/test_switches.h" |
27 #include "chrome/test/ui/ui_test.h" | 27 #include "chrome/test/ui/ui_test.h" |
28 #include "content/common/debug_flags.h" | |
29 #include "content/public/common/process_type.h" | 28 #include "content/public/common/process_type.h" |
30 #include "ipc/ipc_channel.h" | 29 #include "ipc/ipc_channel.h" |
31 #include "ipc/ipc_descriptors.h" | 30 #include "ipc/ipc_descriptors.h" |
32 #include "sql/connection.h" | 31 #include "sql/connection.h" |
33 | 32 |
34 #if defined(OS_POSIX) | 33 #if defined(OS_POSIX) |
35 #include <signal.h> | 34 #include <signal.h> |
36 #endif | 35 #endif |
37 | 36 |
38 namespace { | 37 namespace { |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 } | 428 } |
430 | 429 |
431 bool ProxyLauncher::LaunchBrowserHelper(const LaunchState& state, | 430 bool ProxyLauncher::LaunchBrowserHelper(const LaunchState& state, |
432 bool main_launch, | 431 bool main_launch, |
433 bool wait, | 432 bool wait, |
434 base::ProcessHandle* process) { | 433 base::ProcessHandle* process) { |
435 CommandLine command_line(state.command); | 434 CommandLine command_line(state.command); |
436 | 435 |
437 // Add command line arguments that should be applied to all UI tests. | 436 // Add command line arguments that should be applied to all UI tests. |
438 PrepareTestCommandline(&command_line, state.include_testing_id); | 437 PrepareTestCommandline(&command_line, state.include_testing_id); |
439 DebugFlags::ProcessDebugFlags( | |
440 &command_line, content::PROCESS_TYPE_UNKNOWN, false); | |
441 | 438 |
442 // Sometimes one needs to run the browser under a special environment | 439 // Sometimes one needs to run the browser under a special environment |
443 // (e.g. valgrind) without also running the test harness (e.g. python) | 440 // (e.g. valgrind) without also running the test harness (e.g. python) |
444 // under the special environment. Provide a way to wrap the browser | 441 // under the special environment. Provide a way to wrap the browser |
445 // commandline with a special prefix to invoke the special environment. | 442 // commandline with a special prefix to invoke the special environment. |
446 const char* browser_wrapper = getenv("BROWSER_WRAPPER"); | 443 const char* browser_wrapper = getenv("BROWSER_WRAPPER"); |
447 if (browser_wrapper) { | 444 if (browser_wrapper) { |
448 #if defined(OS_WIN) | 445 #if defined(OS_WIN) |
449 command_line.PrependWrapper(ASCIIToWide(browser_wrapper)); | 446 command_line.PrependWrapper(ASCIIToWide(browser_wrapper)); |
450 #elif defined(OS_POSIX) | 447 #elif defined(OS_POSIX) |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 return LaunchBrowserAndServer(state, wait_for_initial_loads); | 592 return LaunchBrowserAndServer(state, wait_for_initial_loads); |
596 } | 593 } |
597 | 594 |
598 void AnonymousProxyLauncher::TerminateConnection() { | 595 void AnonymousProxyLauncher::TerminateConnection() { |
599 CloseBrowserAndServer(); | 596 CloseBrowserAndServer(); |
600 } | 597 } |
601 | 598 |
602 std::string AnonymousProxyLauncher::PrefixedChannelID() const { | 599 std::string AnonymousProxyLauncher::PrefixedChannelID() const { |
603 return channel_id_; | 600 return channel_id_; |
604 } | 601 } |
OLD | NEW |