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/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "content/browser/download/download_manager_impl.h" | 7 #include "content/browser/download/download_manager_impl.h" |
8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // without network loads (e.g., about:blank, data URLs). | 238 // without network loads (e.g., about:blank, data URLs). |
239 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, | 239 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
240 DISABLED_CrossSiteImmediateLoadOnunloadCookie) { | 240 DISABLED_CrossSiteImmediateLoadOnunloadCookie) { |
241 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 241 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
242 | 242 |
243 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); | 243 GURL url = embedded_test_server()->GetURL("/onunload_cookie.html"); |
244 CheckTitleTest(url, "set cookie on unload"); | 244 CheckTitleTest(url, "set cookie on unload"); |
245 | 245 |
246 // Navigate to a cross-site page that loads immediately without making a | 246 // Navigate to a cross-site page that loads immediately without making a |
247 // network request. The unload event should still be run. | 247 // network request. The unload event should still be run. |
248 NavigateToURL(shell(), GURL("about:blank")); | 248 NavigateToURL(shell(), GURL(kAboutBlankURL)); |
249 | 249 |
250 // Check that the cookie was set. | 250 // Check that the cookie was set. |
251 EXPECT_EQ("onunloadCookie=foo", GetCookies(url)); | 251 EXPECT_EQ("onunloadCookie=foo", GetCookies(url)); |
252 } | 252 } |
253 | 253 |
254 namespace { | 254 namespace { |
255 | 255 |
256 // Handles |request| by serving a redirect response. | 256 // Handles |request| by serving a redirect response. |
257 scoped_ptr<net::test_server::HttpResponse> NoContentResponseHandler( | 257 scoped_ptr<net::test_server::HttpResponse> NoContentResponseHandler( |
258 const std::string& path, | 258 const std::string& path, |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 CrossSiteFailedRequest) { | 420 CrossSiteFailedRequest) { |
421 // Visit another URL first to trigger a cross-site navigation. | 421 // Visit another URL first to trigger a cross-site navigation. |
422 NavigateToURL(shell(), GetTestUrl("", "simple_page.html")); | 422 NavigateToURL(shell(), GetTestUrl("", "simple_page.html")); |
423 | 423 |
424 // Visit a URL that fails without calling ResourceDispatcherHost::Read. | 424 // Visit a URL that fails without calling ResourceDispatcherHost::Read. |
425 GURL broken_url("chrome://theme"); | 425 GURL broken_url("chrome://theme"); |
426 NavigateToURL(shell(), broken_url); | 426 NavigateToURL(shell(), broken_url); |
427 } | 427 } |
428 | 428 |
429 } // namespace content | 429 } // namespace content |
OLD | NEW |