| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 L"NOTE: Crash service not ported to this platform!"; | 78 L"NOTE: Crash service not ported to this platform!"; |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 UITestBase::UITestBase() | 81 UITestBase::UITestBase() |
| 82 : launch_arguments_(CommandLine::NO_PROGRAM), | 82 : launch_arguments_(CommandLine::NO_PROGRAM), |
| 83 expected_errors_(0), | 83 expected_errors_(0), |
| 84 expected_crashes_(0), | 84 expected_crashes_(0), |
| 85 homepage_(chrome::kAboutBlankURL), | 85 homepage_(chrome::kAboutBlankURL), |
| 86 wait_for_initial_loads_(true), | 86 wait_for_initial_loads_(true), |
| 87 dom_automation_enabled_(false), | 87 dom_automation_enabled_(false), |
| 88 stats_collection_extension_enabled_(false), |
| 88 show_window_(false), | 89 show_window_(false), |
| 89 clear_profile_(true), | 90 clear_profile_(true), |
| 90 include_testing_id_(true), | 91 include_testing_id_(true), |
| 91 enable_file_cookies_(true), | 92 enable_file_cookies_(true), |
| 92 profile_type_(UITestBase::DEFAULT_THEME) { | 93 profile_type_(UITestBase::DEFAULT_THEME) { |
| 93 PathService::Get(chrome::DIR_APP, &browser_directory_); | 94 PathService::Get(chrome::DIR_APP, &browser_directory_); |
| 94 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_); | 95 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_); |
| 95 } | 96 } |
| 96 | 97 |
| 97 UITestBase::UITestBase(MessageLoop::Type msg_loop_type) | 98 UITestBase::UITestBase(MessageLoop::Type msg_loop_type) |
| 98 : launch_arguments_(CommandLine::NO_PROGRAM), | 99 : launch_arguments_(CommandLine::NO_PROGRAM), |
| 99 expected_errors_(0), | 100 expected_errors_(0), |
| 100 expected_crashes_(0), | 101 expected_crashes_(0), |
| 101 wait_for_initial_loads_(true), | 102 wait_for_initial_loads_(true), |
| 102 dom_automation_enabled_(false), | 103 dom_automation_enabled_(false), |
| 104 stats_collection_extension_enabled_(false), |
| 103 show_window_(false), | 105 show_window_(false), |
| 104 clear_profile_(true), | 106 clear_profile_(true), |
| 105 include_testing_id_(true), | 107 include_testing_id_(true), |
| 106 enable_file_cookies_(true), | 108 enable_file_cookies_(true), |
| 107 profile_type_(UITestBase::DEFAULT_THEME) { | 109 profile_type_(UITestBase::DEFAULT_THEME) { |
| 108 PathService::Get(chrome::DIR_APP, &browser_directory_); | 110 PathService::Get(chrome::DIR_APP, &browser_directory_); |
| 109 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_); | 111 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_); |
| 110 } | 112 } |
| 111 | 113 |
| 112 UITestBase::~UITestBase() {} | 114 UITestBase::~UITestBase() {} |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 test_launcher_utils::PrepareBrowserCommandLineForTests(&launch_arguments_); | 184 test_launcher_utils::PrepareBrowserCommandLineForTests(&launch_arguments_); |
| 183 | 185 |
| 184 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWaitForDebugger)) | 186 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWaitForDebugger)) |
| 185 launch_arguments_.AppendSwitch(switches::kWaitForDebugger); | 187 launch_arguments_.AppendSwitch(switches::kWaitForDebugger); |
| 186 | 188 |
| 187 // We need cookies on file:// for things like the page cycler. | 189 // We need cookies on file:// for things like the page cycler. |
| 188 if (enable_file_cookies_) | 190 if (enable_file_cookies_) |
| 189 launch_arguments_.AppendSwitch(switches::kEnableFileCookies); | 191 launch_arguments_.AppendSwitch(switches::kEnableFileCookies); |
| 190 if (dom_automation_enabled_) | 192 if (dom_automation_enabled_) |
| 191 launch_arguments_.AppendSwitch(switches::kDomAutomationController); | 193 launch_arguments_.AppendSwitch(switches::kDomAutomationController); |
| 194 if (stats_collection_extension_enabled_) |
| 195 launch_arguments_.AppendSwitch(switches::kStatsCollectionExtension); |
| 192 // Allow off-store extension installs. | 196 // Allow off-store extension installs. |
| 193 launch_arguments_.AppendSwitchASCII( | 197 launch_arguments_.AppendSwitchASCII( |
| 194 switches::kEasyOffStoreExtensionInstall, "1"); | 198 switches::kEasyOffStoreExtensionInstall, "1"); |
| 195 if (!homepage_.empty()) { | 199 if (!homepage_.empty()) { |
| 196 // Pass |homepage_| both as an arg (so that it opens on startup) and to the | 200 // Pass |homepage_| both as an arg (so that it opens on startup) and to the |
| 197 // homepage switch (so that the homepage is set). | 201 // homepage switch (so that the homepage is set). |
| 198 | 202 |
| 199 if (!launch_arguments_.HasSwitch(switches::kHomePage)) | 203 if (!launch_arguments_.HasSwitch(switches::kHomePage)) |
| 200 launch_arguments_.AppendSwitchASCII(switches::kHomePage, homepage_); | 204 launch_arguments_.AppendSwitchASCII(switches::kHomePage, homepage_); |
| 201 | 205 |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 ASSERT_TRUE(session_end_completed); | 718 ASSERT_TRUE(session_end_completed); |
| 715 | 719 |
| 716 // Make sure session restore says we didn't crash. | 720 // Make sure session restore says we didn't crash. |
| 717 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); | 721 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); |
| 718 ASSERT_TRUE(profile_prefs.get()); | 722 ASSERT_TRUE(profile_prefs.get()); |
| 719 std::string exit_type; | 723 std::string exit_type; |
| 720 ASSERT_TRUE(profile_prefs->GetString(prefs::kSessionExitedCleanly, | 724 ASSERT_TRUE(profile_prefs->GetString(prefs::kSessionExitedCleanly, |
| 721 &exit_type)); | 725 &exit_type)); |
| 722 EXPECT_EQ(ProfileImpl::kPrefExitTypeNormal, exit_type); | 726 EXPECT_EQ(ProfileImpl::kPrefExitTypeNormal, exit_type); |
| 723 } | 727 } |
| OLD | NEW |