Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: content/browser/plugin_browsertest.cc

Issue 1233043003: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/accessibility/android_granularity_movement_browsertest.cc ('k') | content/browser/plugin_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698