| 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 "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/browser_commands.h" | 7 #include "chrome/browser/ui/browser_commands.h" |
| 8 #include "chrome/browser/ui/browser_tabstrip.h" | 8 #include "chrome/browser/ui/browser_tabstrip.h" |
| 9 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 9 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), | 60 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), |
| 61 &title_after_crash)); | 61 &title_after_crash)); |
| 62 EXPECT_NE(title_before_crash, title_after_crash); | 62 EXPECT_NE(title_before_crash, title_after_crash); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Tests that loading a crashed page in a new tab correctly updates the title. | 65 // Tests that loading a crashed page in a new tab correctly updates the title. |
| 66 // There was an earlier bug (1270510) in process-per-site in which the max page | 66 // There was an earlier bug (1270510) in process-per-site in which the max page |
| 67 // ID of the RenderProcessHost was stale, so the NavigationEntry in the new tab | 67 // ID of the RenderProcessHost was stale, so the NavigationEntry in the new tab |
| 68 // was not committed. This prevents regression of that bug. | 68 // was not committed. This prevents regression of that bug. |
| 69 // http://crbug.com/57158 - Times out sometimes on all platforms. | 69 // http://crbug.com/57158 - Times out sometimes on all platforms. |
| 70 IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, LoadInNewTab) { | 70 #if defined(OS_LINUX) |
| 71 // http://crbug.com/144278 - failing on linux |
| 72 #define MAYBE_LoadInNewTab DISABLED_LoadInNewTab |
| 73 #else |
| 74 #define MAYBE_LoadInNewTab LoadInNewTab |
| 75 #endif |
| 76 |
| 77 IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, MAYBE_LoadInNewTab) { |
| 71 const FilePath::CharType* kTitle2File = FILE_PATH_LITERAL("title2.html"); | 78 const FilePath::CharType* kTitle2File = FILE_PATH_LITERAL("title2.html"); |
| 72 | 79 |
| 73 ui_test_utils::NavigateToURL(browser(), | 80 ui_test_utils::NavigateToURL(browser(), |
| 74 ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory), | 81 ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory), |
| 75 FilePath(kTitle2File))); | 82 FilePath(kTitle2File))); |
| 76 | 83 |
| 77 string16 title_before_crash; | 84 string16 title_before_crash; |
| 78 string16 title_after_crash; | 85 string16 title_after_crash; |
| 79 | 86 |
| 80 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), | 87 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), |
| 81 &title_before_crash)); | 88 &title_before_crash)); |
| 82 SimulateRendererCrash(browser()); | 89 SimulateRendererCrash(browser()); |
| 83 content::WindowedNotificationObserver observer( | 90 content::WindowedNotificationObserver observer( |
| 84 content::NOTIFICATION_LOAD_STOP, | 91 content::NOTIFICATION_LOAD_STOP, |
| 85 content::Source<NavigationController>( | 92 content::Source<NavigationController>( |
| 86 &chrome::GetActiveWebContents(browser())->GetController())); | 93 &chrome::GetActiveWebContents(browser())->GetController())); |
| 87 chrome::Reload(browser(), CURRENT_TAB); | 94 chrome::Reload(browser(), CURRENT_TAB); |
| 88 observer.Wait(); | 95 observer.Wait(); |
| 89 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), | 96 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), |
| 90 &title_after_crash)); | 97 &title_after_crash)); |
| 91 EXPECT_EQ(title_before_crash, title_after_crash); | 98 EXPECT_EQ(title_before_crash, title_after_crash); |
| 92 } | 99 } |
| OLD | NEW |