| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "chrome/common/url_constants.h" | 43 #include "chrome/common/url_constants.h" |
| 44 #include "chrome/test/automation/automation_proxy.h" | 44 #include "chrome/test/automation/automation_proxy.h" |
| 45 #include "chrome/test/automation/browser_proxy.h" | 45 #include "chrome/test/automation/browser_proxy.h" |
| 46 #include "chrome/test/automation/proxy_launcher.h" | 46 #include "chrome/test/automation/proxy_launcher.h" |
| 47 #include "chrome/test/automation/tab_proxy.h" | 47 #include "chrome/test/automation/tab_proxy.h" |
| 48 #include "chrome/test/automation/window_proxy.h" | 48 #include "chrome/test/automation/window_proxy.h" |
| 49 #include "chrome/test/base/chrome_process_util.h" | 49 #include "chrome/test/base/chrome_process_util.h" |
| 50 #include "chrome/test/base/test_launcher_utils.h" | 50 #include "chrome/test/base/test_launcher_utils.h" |
| 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 "extensions/common/switches.h" |
| 53 #include "net/base/net_util.h" | 54 #include "net/base/net_util.h" |
| 54 #include "ui/gl/gl_implementation.h" | 55 #include "ui/gl/gl_implementation.h" |
| 55 #include "url/gurl.h" | 56 #include "url/gurl.h" |
| 56 | 57 |
| 57 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
| 58 #include "base/win/windows_version.h" | 59 #include "base/win/windows_version.h" |
| 59 #endif | 60 #endif |
| 60 | 61 |
| 61 using base::Time; | 62 using base::Time; |
| 62 using base::TimeDelta; | 63 using base::TimeDelta; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 183 |
| 183 // We need cookies on file:// for things like the page cycler. | 184 // We need cookies on file:// for things like the page cycler. |
| 184 if (enable_file_cookies_) | 185 if (enable_file_cookies_) |
| 185 launch_arguments_.AppendSwitch(switches::kEnableFileCookies); | 186 launch_arguments_.AppendSwitch(switches::kEnableFileCookies); |
| 186 if (dom_automation_enabled_) | 187 if (dom_automation_enabled_) |
| 187 launch_arguments_.AppendSwitch(switches::kDomAutomationController); | 188 launch_arguments_.AppendSwitch(switches::kDomAutomationController); |
| 188 if (stats_collection_controller_enabled_) | 189 if (stats_collection_controller_enabled_) |
| 189 launch_arguments_.AppendSwitch(switches::kStatsCollectionController); | 190 launch_arguments_.AppendSwitch(switches::kStatsCollectionController); |
| 190 // Allow off-store extension installs. | 191 // Allow off-store extension installs. |
| 191 launch_arguments_.AppendSwitchASCII( | 192 launch_arguments_.AppendSwitchASCII( |
| 192 switches::kEasyOffStoreExtensionInstall, "1"); | 193 extensions::switches::kEasyOffStoreExtensionInstall, "1"); |
| 193 if (!homepage_.empty()) { | 194 if (!homepage_.empty()) { |
| 194 // Pass |homepage_| both as an arg (so that it opens on startup) and to the | 195 // Pass |homepage_| both as an arg (so that it opens on startup) and to the |
| 195 // homepage switch (so that the homepage is set). | 196 // homepage switch (so that the homepage is set). |
| 196 | 197 |
| 197 if (!launch_arguments_.HasSwitch(switches::kHomePage)) | 198 if (!launch_arguments_.HasSwitch(switches::kHomePage)) |
| 198 launch_arguments_.AppendSwitchASCII(switches::kHomePage, homepage_); | 199 launch_arguments_.AppendSwitchASCII(switches::kHomePage, homepage_); |
| 199 | 200 |
| 200 if (launch_arguments_.GetArgs().empty() && | 201 if (launch_arguments_.GetArgs().empty() && |
| 201 !launch_arguments_.HasSwitch(switches::kRestoreLastSession)) { | 202 !launch_arguments_.HasSwitch(switches::kRestoreLastSession)) { |
| 202 launch_arguments_.AppendArg(homepage_); | 203 launch_arguments_.AppendArg(homepage_); |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 ASSERT_TRUE(session_end_completed); | 683 ASSERT_TRUE(session_end_completed); |
| 683 | 684 |
| 684 // Make sure session restore says we didn't crash. | 685 // Make sure session restore says we didn't crash. |
| 685 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); | 686 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); |
| 686 ASSERT_TRUE(profile_prefs.get()); | 687 ASSERT_TRUE(profile_prefs.get()); |
| 687 std::string exit_type; | 688 std::string exit_type; |
| 688 ASSERT_TRUE(profile_prefs->GetString(prefs::kSessionExitedCleanly, | 689 ASSERT_TRUE(profile_prefs->GetString(prefs::kSessionExitedCleanly, |
| 689 &exit_type)); | 690 &exit_type)); |
| 690 EXPECT_EQ(ProfileImpl::kPrefExitTypeNormal, exit_type); | 691 EXPECT_EQ(ProfileImpl::kPrefExitTypeNormal, exit_type); |
| 691 } | 692 } |
| OLD | NEW |