| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser.h" | 6 #include "chrome/browser/browser.h" |
| 7 #include "chrome/browser/tab_contents/navigation_entry.h" | 7 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 8 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
| 9 #include "chrome/common/notification_type.h" | 9 #include "chrome/common/notification_type.h" |
| 10 #include "chrome/common/page_transition_types.h" | 10 #include "chrome/common/page_transition_types.h" |
| 11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
| 12 #include "chrome/test/in_process_browser_test.h" | 12 #include "chrome/test/in_process_browser_test.h" |
| 13 #include "chrome/test/ui_test_utils.h" | 13 #include "chrome/test/ui_test_utils.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "webkit/glue/window_open_disposition.h" | |
| 16 | 15 |
| 17 namespace { | 16 namespace { |
| 18 | 17 |
| 19 void SimulateRendererCrash(Browser* browser) { | 18 void SimulateRendererCrash(Browser* browser) { |
| 20 browser->OpenURL(GURL(chrome::kAboutCrashURL), GURL(), CURRENT_TAB, | 19 browser->OpenURL(GURL(chrome::kAboutCrashURL), GURL(), CURRENT_TAB, |
| 21 PageTransition::TYPED); | 20 PageTransition::TYPED); |
| 22 ui_test_utils::WaitForNotification( | 21 ui_test_utils::WaitForNotification( |
| 23 NotificationType::TAB_CONTENTS_DISCONNECTED); | 22 NotificationType::TAB_CONTENTS_DISCONNECTED); |
| 24 } | 23 } |
| 25 | 24 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 73 |
| 75 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), | 74 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), |
| 76 &title_before_crash)); | 75 &title_before_crash)); |
| 77 SimulateRendererCrash(browser()); | 76 SimulateRendererCrash(browser()); |
| 78 browser()->Reload(CURRENT_TAB); | 77 browser()->Reload(CURRENT_TAB); |
| 79 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); | 78 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); |
| 80 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), | 79 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), |
| 81 &title_after_crash)); | 80 &title_after_crash)); |
| 82 EXPECT_EQ(title_before_crash, title_after_crash); | 81 EXPECT_EQ(title_before_crash, title_after_crash); |
| 83 } | 82 } |
| OLD | NEW |