OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 // No default browser check, it would create an info-bar (if we are not the | 683 // No default browser check, it would create an info-bar (if we are not the |
684 // default browser) that could conflicts with some tests expectations. | 684 // default browser) that could conflicts with some tests expectations. |
685 command_line.AppendSwitch(switches::kNoDefaultBrowserCheck); | 685 command_line.AppendSwitch(switches::kNoDefaultBrowserCheck); |
686 | 686 |
687 // This is a UI test. | 687 // This is a UI test. |
688 command_line.AppendSwitchASCII(switches::kTestType, kUITestType); | 688 command_line.AppendSwitchASCII(switches::kTestType, kUITestType); |
689 | 689 |
690 // Tell the browser to use a temporary directory just for this test. | 690 // Tell the browser to use a temporary directory just for this test. |
691 command_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir()); | 691 command_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir()); |
692 | 692 |
693 // Force tests to use OSMesa if they launch the GPU process. | |
694 command_line.AppendSwitchASCII(switches::kUseGL, | |
695 gfx::kGLImplementationOSMesaName); | |
696 | |
697 // Mac does not support accelerated compositing with OSMesa. Disable on all | |
698 // platforms so it is consistent. http://crbug.com/58343 | |
699 command_line.AppendSwitch(switches::kDisableAcceleratedCompositing); | |
700 | |
701 // We need cookies on file:// for things like the page cycler. | 693 // We need cookies on file:// for things like the page cycler. |
702 if (enable_file_cookies_) | 694 if (enable_file_cookies_) |
703 command_line.AppendSwitch(switches::kEnableFileCookies); | 695 command_line.AppendSwitch(switches::kEnableFileCookies); |
704 | 696 |
705 if (dom_automation_enabled_) | 697 if (dom_automation_enabled_) |
706 command_line.AppendSwitch(switches::kDomAutomationController); | 698 command_line.AppendSwitch(switches::kDomAutomationController); |
707 | 699 |
708 if (include_testing_id_) { | 700 if (include_testing_id_) { |
709 command_line.AppendSwitchASCII(switches::kTestingChannelID, | 701 command_line.AppendSwitchASCII(switches::kTestingChannelID, |
710 server_->channel_id()); | 702 server_->channel_id()); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 831 |
840 void UITest::SetUp() { | 832 void UITest::SetUp() { |
841 // Pass the test case name to chrome.exe on the command line to help with | 833 // Pass the test case name to chrome.exe on the command line to help with |
842 // parsing Purify output. | 834 // parsing Purify output. |
843 const testing::TestInfo* const test_info = | 835 const testing::TestInfo* const test_info = |
844 testing::UnitTest::GetInstance()->current_test_info(); | 836 testing::UnitTest::GetInstance()->current_test_info(); |
845 if (test_info) { | 837 if (test_info) { |
846 set_ui_test_name(test_info->test_case_name() + std::string(".") + | 838 set_ui_test_name(test_info->test_case_name() + std::string(".") + |
847 test_info->name()); | 839 test_info->name()); |
848 } | 840 } |
| 841 |
| 842 // Force tests to use OSMesa if they launch the GPU process. This is in |
| 843 // UITest::SetUp so that it does not affect pyautolib, which runs tests that |
| 844 // do not work with OSMesa. |
| 845 launch_arguments_.AppendSwitchASCII(switches::kUseGL, |
| 846 gfx::kGLImplementationOSMesaName); |
| 847 |
| 848 // Mac does not support accelerated compositing with OSMesa. Disable on all |
| 849 // platforms so it is consistent. http://crbug.com/58343 |
| 850 launch_arguments_.AppendSwitch(switches::kDisableAcceleratedCompositing); |
| 851 |
849 UITestBase::SetUp(); | 852 UITestBase::SetUp(); |
850 PlatformTest::SetUp(); | 853 PlatformTest::SetUp(); |
851 } | 854 } |
852 | 855 |
853 void UITest::TearDown() { | 856 void UITest::TearDown() { |
854 UITestBase::TearDown(); | 857 UITestBase::TearDown(); |
855 PlatformTest::TearDown(); | 858 PlatformTest::TearDown(); |
856 } | 859 } |
857 | 860 |
858 AutomationProxy* UITest::CreateAutomationProxy(int execution_timeout) { | 861 AutomationProxy* UITest::CreateAutomationProxy(int execution_timeout) { |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 } | 1182 } |
1180 | 1183 |
1181 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() | 1184 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() |
1182 << " seconds" | 1185 << " seconds" |
1183 << " call failed " << fail_count << " times" | 1186 << " call failed " << fail_count << " times" |
1184 << " state was incorrect " << incorrect_state_count << " times"; | 1187 << " state was incorrect " << incorrect_state_count << " times"; |
1185 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; | 1188 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; |
1186 return false; | 1189 return false; |
1187 } | 1190 } |
1188 | 1191 |
OLD | NEW |