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/files/file_path.h" | 5 #include "base/files/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/tabs/tab_strip_model.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
11 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
12 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
13 #include "content/public/browser/notification_types.h" | 13 #include "content/public/browser/notification_types.h" |
14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
15 #include "content/public/common/page_transition_types.h" | 15 #include "content/public/common/page_transition_types.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 using content::NavigationController; | 18 using content::NavigationController; |
19 using content::OpenURLParams; | 19 using content::OpenURLParams; |
20 using content::Referrer; | 20 using content::Referrer; |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 void SimulateRendererCrash(Browser* browser) { | 24 void SimulateRendererCrash(Browser* browser) { |
25 content::WindowedNotificationObserver observer( | 25 content::WindowedNotificationObserver observer( |
26 content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, | 26 content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, |
27 content::NotificationService::AllSources()); | 27 content::NotificationService::AllSources()); |
28 browser->OpenURL(OpenURLParams( | 28 browser->OpenURL(OpenURLParams( |
29 GURL(chrome::kChromeUICrashURL), Referrer(), CURRENT_TAB, | 29 GURL(content::kChromeUICrashURL), Referrer(), CURRENT_TAB, |
30 content::PAGE_TRANSITION_TYPED, false)); | 30 content::PAGE_TRANSITION_TYPED, false)); |
31 observer.Wait(); | 31 observer.Wait(); |
32 } | 32 } |
33 | 33 |
34 } // namespace | 34 } // namespace |
35 | 35 |
36 class CrashRecoveryBrowserTest : public InProcessBrowserTest { | 36 class CrashRecoveryBrowserTest : public InProcessBrowserTest { |
37 }; | 37 }; |
38 | 38 |
39 // Test that reload works after a crash. | 39 // Test that reload works after a crash. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 content::NOTIFICATION_LOAD_STOP, | 85 content::NOTIFICATION_LOAD_STOP, |
86 content::Source<NavigationController>( | 86 content::Source<NavigationController>( |
87 &browser()->tab_strip_model()->GetActiveWebContents()-> | 87 &browser()->tab_strip_model()->GetActiveWebContents()-> |
88 GetController())); | 88 GetController())); |
89 chrome::Reload(browser(), CURRENT_TAB); | 89 chrome::Reload(browser(), CURRENT_TAB); |
90 observer.Wait(); | 90 observer.Wait(); |
91 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), | 91 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), |
92 &title_after_crash)); | 92 &title_after_crash)); |
93 EXPECT_EQ(title_before_crash, title_after_crash); | 93 EXPECT_EQ(title_before_crash, title_after_crash); |
94 } | 94 } |
OLD | NEW |