| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 10 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 | 521 |
| 522 private: | 522 private: |
| 523 // ResourceDispatcherHostDelegate implementation: | 523 // ResourceDispatcherHostDelegate implementation: |
| 524 void OnResponseStarted(net::URLRequest* request, | 524 void OnResponseStarted(net::URLRequest* request, |
| 525 ResourceContext* resource_context, | 525 ResourceContext* resource_context, |
| 526 ResourceResponse* response, | 526 ResourceResponse* response, |
| 527 IPC::Sender* sender) override { | 527 IPC::Sender* sender) override { |
| 528 // The URL below comes from plugin_geturl_test.cc. | 528 // The URL below comes from plugin_geturl_test.cc. |
| 529 if (!base::EndsWith(request->url().spec(), | 529 if (!base::EndsWith(request->url().spec(), |
| 530 "npapi/plugin_ref_target_page.html", | 530 "npapi/plugin_ref_target_page.html", |
| 531 true)) { | 531 base::CompareCase::SENSITIVE)) { |
| 532 return; | 532 return; |
| 533 } | 533 } |
| 534 net::HttpRequestHeaders headers; | 534 net::HttpRequestHeaders headers; |
| 535 bool found_cookie = false; | 535 bool found_cookie = false; |
| 536 if (request->GetFullRequestHeaders(&headers) && | 536 if (request->GetFullRequestHeaders(&headers) && |
| 537 headers.ToString().find("Cookie: blah") != std::string::npos) { | 537 headers.ToString().find("Cookie: blah") != std::string::npos) { |
| 538 found_cookie = true; | 538 found_cookie = true; |
| 539 } | 539 } |
| 540 BrowserThread::PostTask( | 540 BrowserThread::PostTask( |
| 541 BrowserThread::UI, | 541 BrowserThread::UI, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 570 ResourceDispatcherHostDelegate* old_delegate = | 570 ResourceDispatcherHostDelegate* old_delegate = |
| 571 ResourceDispatcherHostImpl::Get()->delegate(); | 571 ResourceDispatcherHostImpl::Get()->delegate(); |
| 572 ResourceDispatcherHostImpl::Get()->SetDelegate(&test_delegate); | 572 ResourceDispatcherHostImpl::Get()->SetDelegate(&test_delegate); |
| 573 LoadAndWait(url); | 573 LoadAndWait(url); |
| 574 test_delegate.WaitForPluginRequest(); | 574 test_delegate.WaitForPluginRequest(); |
| 575 ASSERT_TRUE(test_delegate.found_cookie()); | 575 ASSERT_TRUE(test_delegate.found_cookie()); |
| 576 ResourceDispatcherHostImpl::Get()->SetDelegate(old_delegate); | 576 ResourceDispatcherHostImpl::Get()->SetDelegate(old_delegate); |
| 577 } | 577 } |
| 578 | 578 |
| 579 } // namespace content | 579 } // namespace content |
| OLD | NEW |