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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 | 406 |
407 bool UITestBase::CloseBrowser(BrowserProxy* browser, | 407 bool UITestBase::CloseBrowser(BrowserProxy* browser, |
408 bool* application_closed) const { | 408 bool* application_closed) const { |
409 DCHECK(application_closed); | 409 DCHECK(application_closed); |
410 if (!browser->is_valid() || !browser->handle()) | 410 if (!browser->is_valid() || !browser->handle()) |
411 return false; | 411 return false; |
412 | 412 |
413 bool result = true; | 413 bool result = true; |
414 | 414 |
415 bool succeeded = automation()->Send(new AutomationMsg_CloseBrowser( | 415 bool succeeded = automation()->Send(new AutomationMsg_CloseBrowser( |
416 browser->handle(), &result)); | 416 browser->handle(), &result, application_closed)); |
417 | 417 |
418 if (!succeeded) | 418 if (!succeeded) |
419 return false; | 419 return false; |
420 | 420 |
421 if (*application_closed) { | 421 if (*application_closed) { |
422 int exit_code = -1; | 422 int exit_code = -1; |
423 EXPECT_TRUE(launcher_->WaitForBrowserProcessToQuit( | 423 EXPECT_TRUE(launcher_->WaitForBrowserProcessToQuit( |
424 TestTimeouts::action_max_timeout(), &exit_code)); | 424 TestTimeouts::action_max_timeout(), &exit_code)); |
425 EXPECT_EQ(0, exit_code); // Expect a clean shutown. | 425 EXPECT_EQ(0, exit_code); // Expect a clean shutown. |
426 } | 426 } |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 &session_end_completed)); | 733 &session_end_completed)); |
734 ASSERT_TRUE(session_end_completed); | 734 ASSERT_TRUE(session_end_completed); |
735 | 735 |
736 // Make sure session restore says we didn't crash. | 736 // Make sure session restore says we didn't crash. |
737 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); | 737 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); |
738 ASSERT_TRUE(profile_prefs.get()); | 738 ASSERT_TRUE(profile_prefs.get()); |
739 ASSERT_TRUE(profile_prefs->GetBoolean(prefs::kSessionExitedCleanly, | 739 ASSERT_TRUE(profile_prefs->GetBoolean(prefs::kSessionExitedCleanly, |
740 &exited_cleanly)); | 740 &exited_cleanly)); |
741 ASSERT_TRUE(exited_cleanly); | 741 ASSERT_TRUE(exited_cleanly); |
742 } | 742 } |
OLD | NEW |