| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "content/common/debug_flags.h" | 50 #include "content/common/debug_flags.h" |
| 51 #include "googleurl/src/gurl.h" | 51 #include "googleurl/src/gurl.h" |
| 52 #include "net/base/net_util.h" | 52 #include "net/base/net_util.h" |
| 53 #include "ui/gfx/gl/gl_implementation.h" | 53 #include "ui/gfx/gl/gl_implementation.h" |
| 54 | 54 |
| 55 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
| 56 #include "base/win/windows_version.h" | 56 #include "base/win/windows_version.h" |
| 57 #endif | 57 #endif |
| 58 | 58 |
| 59 | 59 |
| 60 #if defined(USE_AURA) |
| 61 #include "ui/gfx/compositor/compositor_switches.h" |
| 62 #endif |
| 63 |
| 60 using base::Time; | 64 using base::Time; |
| 61 using base::TimeDelta; | 65 using base::TimeDelta; |
| 62 using base::TimeTicks; | 66 using base::TimeTicks; |
| 63 | 67 |
| 64 const wchar_t UITestBase::kFailedNoCrashService[] = | 68 const wchar_t UITestBase::kFailedNoCrashService[] = |
| 65 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
| 66 L"NOTE: This test is expected to fail if crash_service.exe is not " | 70 L"NOTE: This test is expected to fail if crash_service.exe is not " |
| 67 L"running. Start it manually before running this test (see the build " | 71 L"running. Start it manually before running this test (see the build " |
| 68 L"output directory)."; | 72 L"output directory)."; |
| 69 #elif defined(OS_LINUX) | 73 #elif defined(OS_LINUX) |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void UITestBase::SetLaunchSwitches() { | 196 void UITestBase::SetLaunchSwitches() { |
| 193 // We need cookies on file:// for things like the page cycler. | 197 // We need cookies on file:// for things like the page cycler. |
| 194 if (enable_file_cookies_) | 198 if (enable_file_cookies_) |
| 195 launch_arguments_.AppendSwitch(switches::kEnableFileCookies); | 199 launch_arguments_.AppendSwitch(switches::kEnableFileCookies); |
| 196 if (dom_automation_enabled_) | 200 if (dom_automation_enabled_) |
| 197 launch_arguments_.AppendSwitch(switches::kDomAutomationController); | 201 launch_arguments_.AppendSwitch(switches::kDomAutomationController); |
| 198 if (!homepage_.empty()) | 202 if (!homepage_.empty()) |
| 199 launch_arguments_.AppendSwitchASCII(switches::kHomePage, homepage_); | 203 launch_arguments_.AppendSwitchASCII(switches::kHomePage, homepage_); |
| 200 if (!test_name_.empty()) | 204 if (!test_name_.empty()) |
| 201 launch_arguments_.AppendSwitchASCII(switches::kTestName, test_name_); | 205 launch_arguments_.AppendSwitchASCII(switches::kTestName, test_name_); |
| 206 #if defined(USE_AURA) |
| 207 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 208 switches::kDisableTestCompositor)) { |
| 209 launch_arguments_.AppendSwitch(switches::kTestCompositor); |
| 210 } |
| 211 #endif |
| 202 } | 212 } |
| 203 | 213 |
| 204 void UITestBase::SetUpProfile() { | 214 void UITestBase::SetUpProfile() { |
| 205 } | 215 } |
| 206 | 216 |
| 207 void UITestBase::LaunchBrowser() { | 217 void UITestBase::LaunchBrowser() { |
| 208 LaunchBrowser(launch_arguments_, clear_profile_); | 218 LaunchBrowser(launch_arguments_, clear_profile_); |
| 209 } | 219 } |
| 210 | 220 |
| 211 void UITestBase::LaunchBrowserAndServer() { | 221 void UITestBase::LaunchBrowserAndServer() { |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms() / kCycles); | 800 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms() / kCycles); |
| 791 } | 801 } |
| 792 | 802 |
| 793 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() | 803 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() |
| 794 << " seconds" | 804 << " seconds" |
| 795 << " call failed " << fail_count << " times" | 805 << " call failed " << fail_count << " times" |
| 796 << " state was incorrect " << incorrect_state_count << " times"; | 806 << " state was incorrect " << incorrect_state_count << " times"; |
| 797 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; | 807 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; |
| 798 return false; | 808 return false; |
| 799 } | 809 } |
| OLD | NEW |