| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
| 8 #include <signal.h> | 8 #include <signal.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #endif | 10 #endif |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 } | 553 } |
| 554 | 554 |
| 555 void UITest::StartHttpServerWithPort(const FilePath& root_directory, | 555 void UITest::StartHttpServerWithPort(const FilePath& root_directory, |
| 556 int port) { | 556 int port) { |
| 557 scoped_ptr<CommandLine> cmd_line(CreateHttpServerCommandLine()); | 557 scoped_ptr<CommandLine> cmd_line(CreateHttpServerCommandLine()); |
| 558 ASSERT_TRUE(cmd_line.get()); | 558 ASSERT_TRUE(cmd_line.get()); |
| 559 cmd_line->AppendSwitchASCII("server", "start"); | 559 cmd_line->AppendSwitchASCII("server", "start"); |
| 560 cmd_line->AppendSwitch("register_cygwin"); | 560 cmd_line->AppendSwitch("register_cygwin"); |
| 561 cmd_line->AppendSwitchPath("root", root_directory); | 561 cmd_line->AppendSwitchPath("root", root_directory); |
| 562 | 562 |
| 563 FilePath layout_tests_dir; |
| 564 PathService::Get(base::DIR_SOURCE_ROOT, &layout_tests_dir); |
| 565 layout_tests_dir = layout_tests_dir.AppendASCII("chrome") |
| 566 .AppendASCII("test") |
| 567 .AppendASCII("data") |
| 568 .AppendASCII("layout_tests") |
| 569 .AppendASCII("LayoutTests"); |
| 570 cmd_line->AppendSwitchPath("layout_tests_dir", layout_tests_dir); |
| 571 |
| 563 // For Windows 7, if we start the lighttpd server on the foreground mode, | 572 // For Windows 7, if we start the lighttpd server on the foreground mode, |
| 564 // it will mess up with the command window and cause conhost.exe to crash. To | 573 // it will mess up with the command window and cause conhost.exe to crash. To |
| 565 // work around this, we start the http server on the background mode. | 574 // work around this, we start the http server on the background mode. |
| 566 #if defined(OS_WIN) | 575 #if defined(OS_WIN) |
| 567 if (base::win::GetVersion() >= base::win::VERSION_WIN7) | 576 if (base::win::GetVersion() >= base::win::VERSION_WIN7) |
| 568 cmd_line->AppendSwitch("run_background"); | 577 cmd_line->AppendSwitch("run_background"); |
| 569 #endif | 578 #endif |
| 570 | 579 |
| 571 if (port) | 580 if (port) |
| 572 cmd_line->AppendSwitchASCII("port", base::IntToString(port)); | 581 cmd_line->AppendSwitchASCII("port", base::IntToString(port)); |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 incorrect_state_count++; | 868 incorrect_state_count++; |
| 860 } | 869 } |
| 861 | 870 |
| 862 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() | 871 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() |
| 863 << " seconds" | 872 << " seconds" |
| 864 << " call failed " << fail_count << " times" | 873 << " call failed " << fail_count << " times" |
| 865 << " state was incorrect " << incorrect_state_count << " times"; | 874 << " state was incorrect " << incorrect_state_count << " times"; |
| 866 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; | 875 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; |
| 867 return false; | 876 return false; |
| 868 } | 877 } |
| OLD | NEW |