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/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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "chrome/test/base/test_switches.h" | 51 #include "chrome/test/base/test_switches.h" |
52 #include "chrome/test/base/testing_profile.h" | 52 #include "chrome/test/base/testing_profile.h" |
53 #include "net/base/net_util.h" | 53 #include "net/base/net_util.h" |
54 #include "ui/gl/gl_implementation.h" | 54 #include "ui/gl/gl_implementation.h" |
55 #include "url/gurl.h" | 55 #include "url/gurl.h" |
56 | 56 |
57 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
58 #include "base/win/windows_version.h" | 58 #include "base/win/windows_version.h" |
59 #endif | 59 #endif |
60 | 60 |
61 #if defined(USE_AURA) | |
62 #include "ui/compositor/compositor_switches.h" | |
63 #endif | |
64 | |
65 using base::Time; | 61 using base::Time; |
66 using base::TimeDelta; | 62 using base::TimeDelta; |
67 using base::TimeTicks; | 63 using base::TimeTicks; |
68 | 64 |
69 const wchar_t UITestBase::kFailedNoCrashService[] = | 65 const wchar_t UITestBase::kFailedNoCrashService[] = |
70 #if defined(OS_WIN) | 66 #if defined(OS_WIN) |
71 L"NOTE: This test is expected to fail if crash_service.exe is not " | 67 L"NOTE: This test is expected to fail if crash_service.exe is not " |
72 L"running. Start it manually before running this test (see the build " | 68 L"running. Start it manually before running this test (see the build " |
73 L"output directory)."; | 69 L"output directory)."; |
74 #elif defined(OS_LINUX) | 70 #elif defined(OS_LINUX) |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 if (!launch_arguments_.HasSwitch(switches::kHomePage)) | 197 if (!launch_arguments_.HasSwitch(switches::kHomePage)) |
202 launch_arguments_.AppendSwitchASCII(switches::kHomePage, homepage_); | 198 launch_arguments_.AppendSwitchASCII(switches::kHomePage, homepage_); |
203 | 199 |
204 if (launch_arguments_.GetArgs().empty() && | 200 if (launch_arguments_.GetArgs().empty() && |
205 !launch_arguments_.HasSwitch(switches::kRestoreLastSession)) { | 201 !launch_arguments_.HasSwitch(switches::kRestoreLastSession)) { |
206 launch_arguments_.AppendArg(homepage_); | 202 launch_arguments_.AppendArg(homepage_); |
207 } | 203 } |
208 } | 204 } |
209 if (!test_name_.empty()) | 205 if (!test_name_.empty()) |
210 launch_arguments_.AppendSwitchASCII(switches::kTestName, test_name_); | 206 launch_arguments_.AppendSwitchASCII(switches::kTestName, test_name_); |
211 #if defined(USE_AURA) | |
212 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
213 switches::kDisableTestCompositor)) { | |
214 launch_arguments_.AppendSwitch(switches::kTestCompositor); | |
215 } | |
216 #endif | |
217 } | 207 } |
218 | 208 |
219 void UITestBase::SetUpProfile() { | 209 void UITestBase::SetUpProfile() { |
220 } | 210 } |
221 | 211 |
222 void UITestBase::LaunchBrowser() { | 212 void UITestBase::LaunchBrowser() { |
223 LaunchBrowser(launch_arguments_, clear_profile_); | 213 LaunchBrowser(launch_arguments_, clear_profile_); |
224 } | 214 } |
225 | 215 |
226 void UITestBase::LaunchBrowserAndServer() { | 216 void UITestBase::LaunchBrowserAndServer() { |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 ASSERT_TRUE(session_end_completed); | 682 ASSERT_TRUE(session_end_completed); |
693 | 683 |
694 // Make sure session restore says we didn't crash. | 684 // Make sure session restore says we didn't crash. |
695 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); | 685 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); |
696 ASSERT_TRUE(profile_prefs.get()); | 686 ASSERT_TRUE(profile_prefs.get()); |
697 std::string exit_type; | 687 std::string exit_type; |
698 ASSERT_TRUE(profile_prefs->GetString(prefs::kSessionExitedCleanly, | 688 ASSERT_TRUE(profile_prefs->GetString(prefs::kSessionExitedCleanly, |
699 &exit_type)); | 689 &exit_type)); |
700 EXPECT_EQ(ProfileImpl::kPrefExitTypeNormal, exit_type); | 690 EXPECT_EQ(ProfileImpl::kPrefExitTypeNormal, exit_type); |
701 } | 691 } |
OLD | NEW |