Chromium Code Reviews| Index: chrome/test/ui/ui_test.cc |
| =================================================================== |
| --- chrome/test/ui/ui_test.cc (revision 106520) |
| +++ chrome/test/ui/ui_test.cc (working copy) |
| @@ -37,6 +37,7 @@ |
| #include "chrome/common/chrome_paths.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/logging_chrome.h" |
| +#include "chrome/common/pref_names.h" |
| #include "chrome/common/url_constants.h" |
| #include "chrome/test/automation/automation_proxy.h" |
| #include "chrome/test/automation/browser_proxy.h" |
| @@ -800,3 +801,26 @@ |
| ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; |
| return false; |
| } |
| + |
| +void UITest::VerifyCleanExit() { |
| + // 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
|
| + scoped_ptr<DictionaryValue> local_prefs(GetLocalState()); |
| + bool exited_cleanly; |
| + ASSERT_TRUE(local_prefs.get()); |
| + ASSERT_TRUE(local_prefs->GetBoolean(prefs::kStabilityExitedCleanly, |
| + &exited_cleanly)); |
| + ASSERT_TRUE(exited_cleanly); |
| + |
| + // And that session end was successful. |
| + bool session_end_completed; |
| + ASSERT_TRUE(local_prefs->GetBoolean(prefs::kStabilitySessionEndCompleted, |
| + &session_end_completed)); |
| + ASSERT_TRUE(session_end_completed); |
| + |
| + // Make sure session restore says we didn't crash. |
| + scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); |
| + ASSERT_TRUE(profile_prefs.get()); |
| + ASSERT_TRUE(profile_prefs->GetBoolean(prefs::kSessionExitedCleanly, |
| + &exited_cleanly)); |
| + ASSERT_TRUE(exited_cleanly); |
| +} |