| 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 400 |
| 401 bool UITestBase::CloseBrowser(BrowserProxy* browser, | 401 bool UITestBase::CloseBrowser(BrowserProxy* browser, |
| 402 bool* application_closed) const { | 402 bool* application_closed) const { |
| 403 DCHECK(application_closed); | 403 DCHECK(application_closed); |
| 404 if (!browser->is_valid() || !browser->handle()) | 404 if (!browser->is_valid() || !browser->handle()) |
| 405 return false; | 405 return false; |
| 406 | 406 |
| 407 bool result = true; | 407 bool result = true; |
| 408 | 408 |
| 409 bool succeeded = automation()->Send(new AutomationMsg_CloseBrowser( | 409 bool succeeded = automation()->Send(new AutomationMsg_CloseBrowser( |
| 410 browser->handle(), &result, application_closed)); | 410 browser->handle(), &result)); |
| 411 | 411 |
| 412 if (!succeeded) | 412 if (!succeeded) |
| 413 return false; | 413 return false; |
| 414 | 414 |
| 415 if (*application_closed) { | 415 if (*application_closed) { |
| 416 int exit_code = -1; | 416 int exit_code = -1; |
| 417 EXPECT_TRUE(launcher_->WaitForBrowserProcessToQuit( | 417 EXPECT_TRUE(launcher_->WaitForBrowserProcessToQuit( |
| 418 TestTimeouts::action_max_timeout_ms(), &exit_code)); | 418 TestTimeouts::action_max_timeout_ms(), &exit_code)); |
| 419 EXPECT_EQ(0, exit_code); // Expect a clean shutown. | 419 EXPECT_EQ(0, exit_code); // Expect a clean shutown. |
| 420 } | 420 } |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 &session_end_completed)); | 727 &session_end_completed)); |
| 728 ASSERT_TRUE(session_end_completed); | 728 ASSERT_TRUE(session_end_completed); |
| 729 | 729 |
| 730 // Make sure session restore says we didn't crash. | 730 // Make sure session restore says we didn't crash. |
| 731 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); | 731 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); |
| 732 ASSERT_TRUE(profile_prefs.get()); | 732 ASSERT_TRUE(profile_prefs.get()); |
| 733 ASSERT_TRUE(profile_prefs->GetBoolean(prefs::kSessionExitedCleanly, | 733 ASSERT_TRUE(profile_prefs->GetBoolean(prefs::kSessionExitedCleanly, |
| 734 &exited_cleanly)); | 734 &exited_cleanly)); |
| 735 ASSERT_TRUE(exited_cleanly); | 735 ASSERT_TRUE(exited_cleanly); |
| 736 } | 736 } |
| OLD | NEW |