| 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 "base/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "chrome/browser/ui/browser.h" | 6 #include "chrome/browser/ui/browser.h" |
| 7 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 7 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 8 #include "chrome/common/url_constants.h" | 8 #include "chrome/common/url_constants.h" |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
| 11 #include "content/browser/tab_contents/navigation_entry.h" | 11 #include "content/browser/tab_contents/navigation_entry.h" |
| 12 #include "content/public/browser/notification_service.h" |
| 12 #include "content/public/browser/notification_types.h" | 13 #include "content/public/browser/notification_types.h" |
| 13 #include "content/public/common/page_transition_types.h" | 14 #include "content/public/common/page_transition_types.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 void SimulateRendererCrash(Browser* browser) { | 19 void SimulateRendererCrash(Browser* browser) { |
| 19 ui_test_utils::WindowedNotificationObserver observer( | 20 ui_test_utils::WindowedNotificationObserver observer( |
| 20 content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED, | 21 content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED, |
| 21 NotificationService::AllSources()); | 22 content::NotificationService::AllSources()); |
| 22 browser->OpenURL(GURL(chrome::kChromeUICrashURL), GURL(), CURRENT_TAB, | 23 browser->OpenURL(GURL(chrome::kChromeUICrashURL), GURL(), CURRENT_TAB, |
| 23 content::PAGE_TRANSITION_TYPED); | 24 content::PAGE_TRANSITION_TYPED); |
| 24 observer.Wait(); | 25 observer.Wait(); |
| 25 } | 26 } |
| 26 | 27 |
| 27 } // namespace | 28 } // namespace |
| 28 | 29 |
| 29 class CrashRecoveryBrowserTest : public InProcessBrowserTest { | 30 class CrashRecoveryBrowserTest : public InProcessBrowserTest { |
| 30 }; | 31 }; |
| 31 | 32 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 ui_test_utils::WindowedNotificationObserver observer( | 76 ui_test_utils::WindowedNotificationObserver observer( |
| 76 content::NOTIFICATION_LOAD_STOP, | 77 content::NOTIFICATION_LOAD_STOP, |
| 77 content::Source<NavigationController>( | 78 content::Source<NavigationController>( |
| 78 &browser()->GetSelectedTabContentsWrapper()->controller())); | 79 &browser()->GetSelectedTabContentsWrapper()->controller())); |
| 79 browser()->Reload(CURRENT_TAB); | 80 browser()->Reload(CURRENT_TAB); |
| 80 observer.Wait(); | 81 observer.Wait(); |
| 81 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), | 82 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), |
| 82 &title_after_crash)); | 83 &title_after_crash)); |
| 83 EXPECT_EQ(title_before_crash, title_after_crash); | 84 EXPECT_EQ(title_before_crash, title_after_crash); |
| 84 } | 85 } |
| OLD | NEW |