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 #if defined(OS_POSIX) | 5 #if defined(OS_POSIX) |
6 #include <signal.h> | 6 #include <signal.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 return; | 231 return; |
232 | 232 |
233 NavigateToDataURL(INFINITE_BEFORE_UNLOAD_HTML, "infinitebeforeunload"); | 233 NavigateToDataURL(INFINITE_BEFORE_UNLOAD_HTML, "infinitebeforeunload"); |
234 // Must navigate to a non-data URL to trigger cross-site codepath. | 234 // Must navigate to a non-data URL to trigger cross-site codepath. |
235 NavigateToNolistenersFileTwiceAsync(); | 235 NavigateToNolistenersFileTwiceAsync(); |
236 } | 236 } |
237 | 237 |
238 // Navigate to a page with an infinite beforeunload handler. | 238 // Navigate to a page with an infinite beforeunload handler. |
239 // Then two two sync crosssite requests to ensure | 239 // Then two two sync crosssite requests to ensure |
240 // we correctly nav to each one. | 240 // we correctly nav to each one. |
241 // Flaky on Win and Linux; http://crbug.com/462671. | 241 // Flaky on Win, Linux, and Mac; http://crbug.com/462671. |
242 #if defined(OS_WIN) || defined(OS_LINUX) | 242 IN_PROC_BROWSER_TEST_F(UnloadTest, DISABLED_CrossSiteInfiniteBeforeUnloadSync) { |
243 #define MAYBE_CrossSiteInfiniteBeforeUnloadSync \ | |
244 DISABLED_CrossSiteInfiniteBeforeUnloadSync | |
245 #else | |
246 #define MAYBE_CrossSiteInfiniteBeforeUnloadSync \ | |
247 CrossSiteInfiniteBeforeUnloadSync | |
248 #endif | |
249 IN_PROC_BROWSER_TEST_F(UnloadTest, MAYBE_CrossSiteInfiniteBeforeUnloadSync) { | |
250 // Tests makes no sense in single-process mode since the renderer is hung. | 243 // Tests makes no sense in single-process mode since the renderer is hung. |
251 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 244 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
252 switches::kSingleProcess)) | 245 switches::kSingleProcess)) |
253 return; | 246 return; |
254 | 247 |
255 NavigateToDataURL(INFINITE_BEFORE_UNLOAD_HTML, "infinitebeforeunload"); | 248 NavigateToDataURL(INFINITE_BEFORE_UNLOAD_HTML, "infinitebeforeunload"); |
256 // Must navigate to a non-data URL to trigger cross-site codepath. | 249 // Must navigate to a non-data URL to trigger cross-site codepath. |
257 NavigateToNolistenersFileTwice(); | 250 NavigateToNolistenersFileTwice(); |
258 } | 251 } |
259 | 252 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 content::WindowedNotificationObserver window_observer( | 639 content::WindowedNotificationObserver window_observer( |
647 chrome::NOTIFICATION_BROWSER_CLOSED, | 640 chrome::NOTIFICATION_BROWSER_CLOSED, |
648 content::NotificationService::AllSources()); | 641 content::NotificationService::AllSources()); |
649 chrome::CloseWindow(browser()); | 642 chrome::CloseWindow(browser()); |
650 CrashTab(beforeunload_contents); | 643 CrashTab(beforeunload_contents); |
651 window_observer.Wait(); | 644 window_observer.Wait(); |
652 } | 645 } |
653 | 646 |
654 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs | 647 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs |
655 // and multiple windows. | 648 // and multiple windows. |
OLD | NEW |