| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 #if defined(OS_MACOSX) | 312 #if defined(OS_MACOSX) |
| 313 #define MAYBE_SingleBeforeUnloadAfterWindowClose \ | 313 #define MAYBE_SingleBeforeUnloadAfterWindowClose \ |
| 314 DISABLED_SingleBeforeUnloadAfterWindowClose | 314 DISABLED_SingleBeforeUnloadAfterWindowClose |
| 315 #else | 315 #else |
| 316 #define MAYBE_SingleBeforeUnloadAfterWindowClose \ | 316 #define MAYBE_SingleBeforeUnloadAfterWindowClose \ |
| 317 SingleBeforeUnloadAfterWindowClose | 317 SingleBeforeUnloadAfterWindowClose |
| 318 #endif | 318 #endif |
| 319 | 319 |
| 320 // Test for crbug.com/11647. A page closed with window.close() should not have | 320 // Test for crbug.com/11647. A page closed with window.close() should not have |
| 321 // two beforeunload dialogs shown. | 321 // two beforeunload dialogs shown. |
| 322 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_SingleBeforeUnloadAfterWindowClose) { | 322 // Disabled for http://code.google.com/p/chromium/issues/detail?id=86346 |
| 323 IN_PROC_BROWSER_TEST_F(BrowserTest, |
| 324 DISABLED_SingleBeforeUnloadAfterWindowClose) { |
| 323 browser()->GetSelectedTabContents()->render_view_host()-> | 325 browser()->GetSelectedTabContents()->render_view_host()-> |
| 324 ExecuteJavascriptInWebFrame(string16(), | 326 ExecuteJavascriptInWebFrame(string16(), |
| 325 ASCIIToUTF16(kOpenNewBeforeUnloadPage)); | 327 ASCIIToUTF16(kOpenNewBeforeUnloadPage)); |
| 326 | 328 |
| 327 // Close the new window with JavaScript, which should show a single | 329 // Close the new window with JavaScript, which should show a single |
| 328 // beforeunload dialog. Then show another alert, to make it easy to verify | 330 // beforeunload dialog. Then show another alert, to make it easy to verify |
| 329 // that a second beforeunload dialog isn't shown. | 331 // that a second beforeunload dialog isn't shown. |
| 330 browser()->GetTabContentsAt(0)->render_view_host()-> | 332 browser()->GetTabContentsAt(0)->render_view_host()-> |
| 331 ExecuteJavascriptInWebFrame(string16(), | 333 ExecuteJavascriptInWebFrame(string16(), |
| 332 ASCIIToUTF16("w.close(); alert('bar');")); | 334 ASCIIToUTF16("w.close(); alert('bar');")); |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 | 850 |
| 849 // The normal browser should now have four. | 851 // The normal browser should now have four. |
| 850 EXPECT_EQ(4, browser()->tab_count()); | 852 EXPECT_EQ(4, browser()->tab_count()); |
| 851 | 853 |
| 852 // Close the additional browsers. | 854 // Close the additional browsers. |
| 853 popup_browser->CloseAllTabs(); | 855 popup_browser->CloseAllTabs(); |
| 854 app_browser->CloseAllTabs(); | 856 app_browser->CloseAllTabs(); |
| 855 app_popup_browser->CloseAllTabs(); | 857 app_popup_browser->CloseAllTabs(); |
| 856 } | 858 } |
| 857 #endif | 859 #endif |
| OLD | NEW |