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 19 matching lines...) Expand all Loading... | |
30 #include "base/threading/platform_thread.h" | 30 #include "base/threading/platform_thread.h" |
31 #include "base/time.h" | 31 #include "base/time.h" |
32 #include "base/utf_string_conversions.h" | 32 #include "base/utf_string_conversions.h" |
33 #include "chrome/app/chrome_command_ids.h" | 33 #include "chrome/app/chrome_command_ids.h" |
34 #include "chrome/browser/net/url_fixer_upper.h" | 34 #include "chrome/browser/net/url_fixer_upper.h" |
35 #include "chrome/common/automation_messages.h" | 35 #include "chrome/common/automation_messages.h" |
36 #include "chrome/common/chrome_constants.h" | 36 #include "chrome/common/chrome_constants.h" |
37 #include "chrome/common/chrome_paths.h" | 37 #include "chrome/common/chrome_paths.h" |
38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
39 #include "chrome/common/logging_chrome.h" | 39 #include "chrome/common/logging_chrome.h" |
40 #include "chrome/common/pref_names.h" | |
40 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
41 #include "chrome/test/automation/automation_proxy.h" | 42 #include "chrome/test/automation/automation_proxy.h" |
42 #include "chrome/test/automation/browser_proxy.h" | 43 #include "chrome/test/automation/browser_proxy.h" |
43 #include "chrome/test/automation/javascript_execution_controller.h" | 44 #include "chrome/test/automation/javascript_execution_controller.h" |
44 #include "chrome/test/automation/proxy_launcher.h" | 45 #include "chrome/test/automation/proxy_launcher.h" |
45 #include "chrome/test/automation/tab_proxy.h" | 46 #include "chrome/test/automation/tab_proxy.h" |
46 #include "chrome/test/automation/window_proxy.h" | 47 #include "chrome/test/automation/window_proxy.h" |
47 #include "chrome/test/base/chrome_process_util.h" | 48 #include "chrome/test/base/chrome_process_util.h" |
48 #include "chrome/test/base/test_switches.h" | 49 #include "chrome/test/base/test_switches.h" |
49 #include "content/common/debug_flags.h" | 50 #include "content/common/debug_flags.h" |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
793 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms() / kCycles); | 794 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms() / kCycles); |
794 } | 795 } |
795 | 796 |
796 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() | 797 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() |
797 << " seconds" | 798 << " seconds" |
798 << " call failed " << fail_count << " times" | 799 << " call failed " << fail_count << " times" |
799 << " state was incorrect " << incorrect_state_count << " times"; | 800 << " state was incorrect " << incorrect_state_count << " times"; |
800 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; | 801 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; |
801 return false; | 802 return false; |
802 } | 803 } |
804 | |
805 void UITest::VerifyCleanExit() { | |
806 // Make sure the UMA metrics say we didn't crash. | |
Paweł Hajdan Jr.
2011/10/24 07:32:51
How about doing that in TerminateBrowser instead?
achuithb
2011/10/24 10:12:39
Since this hardens the tests, I expect there'll be
Paweł Hajdan Jr.
2011/10/24 12:32:14
Generally sounds good, please add a TODO then. Ple
achuithb
2011/10/24 18:57:19
Done. I've opened http://crbug.com/101390 to track
| |
807 scoped_ptr<DictionaryValue> local_prefs(GetLocalState()); | |
808 bool exited_cleanly; | |
809 ASSERT_TRUE(local_prefs.get()); | |
810 ASSERT_TRUE(local_prefs->GetBoolean(prefs::kStabilityExitedCleanly, | |
811 &exited_cleanly)); | |
812 ASSERT_TRUE(exited_cleanly); | |
813 | |
814 // And that session end was successful. | |
815 bool session_end_completed; | |
816 ASSERT_TRUE(local_prefs->GetBoolean(prefs::kStabilitySessionEndCompleted, | |
817 &session_end_completed)); | |
818 ASSERT_TRUE(session_end_completed); | |
819 | |
820 // Make sure session restore says we didn't crash. | |
821 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); | |
822 ASSERT_TRUE(profile_prefs.get()); | |
823 ASSERT_TRUE(profile_prefs->GetBoolean(prefs::kSessionExitedCleanly, | |
824 &exited_cleanly)); | |
825 ASSERT_TRUE(exited_cleanly); | |
826 } | |
OLD | NEW |