| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "content/browser/frame_host/navigation_entry_impl.h" | 10 #include "content/browser/frame_host/navigation_entry_impl.h" |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 WaitForLoadStop(new_shell->web_contents()); | 892 WaitForLoadStop(new_shell->web_contents()); |
| 893 | 893 |
| 894 EXPECT_EQ("foo", | 894 EXPECT_EQ("foo", |
| 895 static_cast<WebContentsImpl*>(new_shell->web_contents()) | 895 static_cast<WebContentsImpl*>(new_shell->web_contents()) |
| 896 ->GetFrameTree()->root()->frame_name()); | 896 ->GetFrameTree()->root()->frame_name()); |
| 897 } | 897 } |
| 898 } | 898 } |
| 899 | 899 |
| 900 // TODO(clamy): Make the test work on Windows and on Mac. On Mac and Windows, | 900 // TODO(clamy): Make the test work on Windows and on Mac. On Mac and Windows, |
| 901 // there seem to be an issue with the ShellJavascriptDialogManager. | 901 // there seem to be an issue with the ShellJavascriptDialogManager. |
| 902 #if defined(OS_WIN) || defined(OS_MACOSX) | 902 // Flaky on all platforms: https://crbug.com/655628 |
| 903 #define MAYBE_NoResetOnBeforeUnloadCanceledOnCommit \ | |
| 904 DISABLED_NoResetOnBeforeUnloadCanceledOnCommit | |
| 905 #else | |
| 906 #define MAYBE_NoResetOnBeforeUnloadCanceledOnCommit \ | |
| 907 NoResetOnBeforeUnloadCanceledOnCommit | |
| 908 #endif | |
| 909 // Test that if a BeforeUnload dialog is destroyed due to the commit of a | 903 // Test that if a BeforeUnload dialog is destroyed due to the commit of a |
| 910 // cross-site navigation, it will not reset the loading state. | 904 // cross-site navigation, it will not reset the loading state. |
| 911 IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, | 905 IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, |
| 912 MAYBE_NoResetOnBeforeUnloadCanceledOnCommit) { | 906 DISABLED_NoResetOnBeforeUnloadCanceledOnCommit) { |
| 913 ASSERT_TRUE(embedded_test_server()->Start()); | 907 ASSERT_TRUE(embedded_test_server()->Start()); |
| 914 const GURL kStartURL( | 908 const GURL kStartURL( |
| 915 embedded_test_server()->GetURL("/hang_before_unload.html")); | 909 embedded_test_server()->GetURL("/hang_before_unload.html")); |
| 916 const GURL kCrossSiteURL( | 910 const GURL kCrossSiteURL( |
| 917 embedded_test_server()->GetURL("bar.com", "/title1.html")); | 911 embedded_test_server()->GetURL("bar.com", "/title1.html")); |
| 918 | 912 |
| 919 // Navigate to a first web page with a BeforeUnload event listener. | 913 // Navigate to a first web page with a BeforeUnload event listener. |
| 920 EXPECT_TRUE(NavigateToURL(shell(), kStartURL)); | 914 EXPECT_TRUE(NavigateToURL(shell(), kStartURL)); |
| 921 | 915 |
| 922 // Start a cross-site navigation that will not commit for the moment. | 916 // Start a cross-site navigation that will not commit for the moment. |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 shell()->LoadURL(GURL("about:blank")); | 1238 shell()->LoadURL(GURL("about:blank")); |
| 1245 base::RunLoop run_loop; | 1239 base::RunLoop run_loop; |
| 1246 shell()->web_contents()->DownloadImage( | 1240 shell()->web_contents()->DownloadImage( |
| 1247 kImageUrl, false, 2, false, | 1241 kImageUrl, false, 2, false, |
| 1248 base::Bind(&ExpectNoValidImageCallback, run_loop.QuitClosure())); | 1242 base::Bind(&ExpectNoValidImageCallback, run_loop.QuitClosure())); |
| 1249 | 1243 |
| 1250 run_loop.Run(); | 1244 run_loop.Run(); |
| 1251 } | 1245 } |
| 1252 | 1246 |
| 1253 } // namespace content | 1247 } // namespace content |
| OLD | NEW |