| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); | 170 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
| 171 content::WaitForLoadStop(GetActiveWebContents()); | 171 content::WaitForLoadStop(GetActiveWebContents()); |
| 172 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); | 172 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); |
| 173 | 173 |
| 174 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); | 174 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
| 175 content::WaitForLoadStop(GetActiveWebContents()); | 175 content::WaitForLoadStop(GetActiveWebContents()); |
| 176 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); | 176 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); |
| 177 } | 177 } |
| 178 | 178 |
| 179 // Tests that a beforeunload handler doesn't run if user navigates to |
| 180 // chrome::crash. |
| 181 IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, BeforeUnloadNotRun) { |
| 182 const char* kBeforeUnloadHTML = |
| 183 "<html><body>" |
| 184 "<script>window.onbeforeunload=function(e){return 'foo'}</script>" |
| 185 "</body></html>"; |
| 186 GURL url(std::string("data:text/html,") + kBeforeUnloadHTML); |
| 187 ui_test_utils::NavigateToURL(browser(), url); |
| 188 SimulateRendererCrash(browser()); |
| 189 } |
| 190 |
| 179 } // namespace | 191 } // namespace |
| 180 | 192 |
| 181 #endif | 193 #endif |
| OLD | NEW |