| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 } | 527 } |
| 528 BrowserThread::PostTask( | 528 BrowserThread::PostTask( |
| 529 BrowserThread::UI, | 529 BrowserThread::UI, |
| 530 FROM_HERE, | 530 FROM_HERE, |
| 531 base::Bind(&TestResourceDispatcherHostDelegate::GotCookie, | 531 base::Bind(&TestResourceDispatcherHostDelegate::GotCookie, |
| 532 base::Unretained(this), found_cookie)); | 532 base::Unretained(this), found_cookie)); |
| 533 } | 533 } |
| 534 | 534 |
| 535 void GotCookie(bool found_cookie) { | 535 void GotCookie(bool found_cookie) { |
| 536 found_cookie_ = found_cookie; | 536 found_cookie_ = found_cookie; |
| 537 if (runner_) | 537 if (runner_.get()) |
| 538 runner_->QuitClosure().Run(); | 538 runner_->QuitClosure().Run(); |
| 539 } | 539 } |
| 540 | 540 |
| 541 scoped_refptr<MessageLoopRunner> runner_; | 541 scoped_refptr<MessageLoopRunner> runner_; |
| 542 bool found_cookie_; | 542 bool found_cookie_; |
| 543 | 543 |
| 544 DISALLOW_COPY_AND_ASSIGN(TestResourceDispatcherHostDelegate); | 544 DISALLOW_COPY_AND_ASSIGN(TestResourceDispatcherHostDelegate); |
| 545 }; | 545 }; |
| 546 | 546 |
| 547 // Ensure that cookies get sent with plugin requests. | 547 // Ensure that cookies get sent with plugin requests. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 558 ResourceDispatcherHostDelegate* old_delegate = | 558 ResourceDispatcherHostDelegate* old_delegate = |
| 559 ResourceDispatcherHostImpl::Get()->delegate(); | 559 ResourceDispatcherHostImpl::Get()->delegate(); |
| 560 ResourceDispatcherHostImpl::Get()->SetDelegate(&test_delegate); | 560 ResourceDispatcherHostImpl::Get()->SetDelegate(&test_delegate); |
| 561 LoadAndWait(url); | 561 LoadAndWait(url); |
| 562 test_delegate.WaitForPluginRequest(); | 562 test_delegate.WaitForPluginRequest(); |
| 563 ASSERT_TRUE(test_delegate.found_cookie()); | 563 ASSERT_TRUE(test_delegate.found_cookie()); |
| 564 ResourceDispatcherHostImpl::Get()->SetDelegate(old_delegate); | 564 ResourceDispatcherHostImpl::Get()->SetDelegate(old_delegate); |
| 565 } | 565 } |
| 566 | 566 |
| 567 } // namespace content | 567 } // namespace content |
| OLD | NEW |