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/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/browser/download/download_manager_impl.h" | 9 #include "content/browser/download/download_manager_impl.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 "sync xhr on unload"); | 216 "sync xhr on unload"); |
217 | 217 |
218 // Navigate to a new page, to dispatch unload event and trigger xhr. | 218 // Navigate to a new page, to dispatch unload event and trigger xhr. |
219 // (the bug would make this step hang the renderer). | 219 // (the bug would make this step hang the renderer). |
220 CheckTitleTest( | 220 CheckTitleTest( |
221 embedded_test_server()->GetURL("/title2.html"), "Title Of Awesomeness"); | 221 embedded_test_server()->GetURL("/title2.html"), "Title Of Awesomeness"); |
222 | 222 |
223 ASSERT_FALSE(got_downloads()); | 223 ASSERT_FALSE(got_downloads()); |
224 } | 224 } |
225 | 225 |
| 226 // Flaky on mac bots. crbug.com/429190 |
| 227 #if defined(OS_MACOSX) |
| 228 #define MAYBE_CrossSiteOnunloadCookie DISABLED_CrossSiteOnunloadCookie |
| 229 #else |
| 230 #define MAYBE_CrossSiteOnunloadCookie CrossSiteOnunloadCookie |
| 231 #endif |
226 // Tests that onunload is run for cross-site requests. (Bug 1114994) | 232 // Tests that onunload is run for cross-site requests. (Bug 1114994) |
227 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 233 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
228 CrossSiteOnunloadCookie) { | 234 MAYBE_CrossSiteOnunloadCookie) { |
229 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 235 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
230 | 236 |
231 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); | 237 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); |
232 CheckTitleTest(url, "set cookie on unload"); | 238 CheckTitleTest(url, "set cookie on unload"); |
233 | 239 |
234 // Navigate to a new cross-site page, to dispatch unload event and set the | 240 // Navigate to a new cross-site page, to dispatch unload event and set the |
235 // cookie. | 241 // cookie. |
236 CheckTitleTest(GetMockURL("content-sniffer-test0.html"), | 242 CheckTitleTest(GetMockURL("content-sniffer-test0.html"), |
237 "Content Sniffer Test 0"); | 243 "Content Sniffer Test 0"); |
238 | 244 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 "http://localhost:%d/set_cookie.html", embedded_test_server()->port())); | 476 "http://localhost:%d/set_cookie.html", embedded_test_server()->port())); |
471 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); | 477 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); |
472 | 478 |
473 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); | 479 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); |
474 ShellNetworkDelegate::SetAcceptAllCookies(false); | 480 ShellNetworkDelegate::SetAcceptAllCookies(false); |
475 | 481 |
476 CheckTitleTest(url, "cookie set"); | 482 CheckTitleTest(url, "cookie set"); |
477 } | 483 } |
478 | 484 |
479 } // namespace content | 485 } // namespace content |
OLD | NEW |