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

Side by Side Diff: chrome/browser/prerender/prerender_test_utils.cc

Issue 2642733002: Prerender: Disable prefetch if there's an appcache. (Closed)
Patch Set: Prerender: Disable prefetch if there's an appcache. Created 3 years, 8 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 "chrome/browser/prerender/prerender_test_utils.h" 5 #include "chrome/browser/prerender/prerender_test_utils.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_TAB_PREFIX, 738 return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_TAB_PREFIX,
739 base::ASCIIToUTF16(page_title)); 739 base::ASCIIToUTF16(page_title));
740 } 740 }
741 741
742 base::string16 PrerenderInProcessBrowserTest::MatchTaskManagerPrerender( 742 base::string16 PrerenderInProcessBrowserTest::MatchTaskManagerPrerender(
743 const char* page_title) { 743 const char* page_title) {
744 return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_PRERENDER_PREFIX, 744 return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_PRERENDER_PREFIX,
745 base::ASCIIToUTF16(page_title)); 745 base::ASCIIToUTF16(page_title));
746 } 746 }
747 747
748 GURL PrerenderInProcessBrowserTest::GetURLWithReplacement(
749 const std::string& url_file,
750 const std::string& replacement_variable,
751 const std::string& replacement_text) {
752 base::StringPairs replacement_pair;
753 replacement_pair.push_back(make_pair(replacement_variable, replacement_text));
754 std::string replacement_path;
755 net::test_server::GetFilePathWithReplacements(url_file, replacement_pair,
756 &replacement_path);
757 return src_server()->GetURL(MakeAbsolute(replacement_path));
758 }
759
748 std::vector<std::unique_ptr<TestPrerender>> 760 std::vector<std::unique_ptr<TestPrerender>>
749 PrerenderInProcessBrowserTest::NavigateWithPrerenders( 761 PrerenderInProcessBrowserTest::NavigateWithPrerenders(
750 const GURL& loader_url, 762 const GURL& loader_url,
751 const std::vector<FinalStatus>& expected_final_status_queue) { 763 const std::vector<FinalStatus>& expected_final_status_queue) {
752 CHECK(!expected_final_status_queue.empty()); 764 CHECK(!expected_final_status_queue.empty());
753 std::vector<std::unique_ptr<TestPrerender>> prerenders; 765 std::vector<std::unique_ptr<TestPrerender>> prerenders;
754 for (size_t i = 0; i < expected_final_status_queue.size(); i++) { 766 for (size_t i = 0; i < expected_final_status_queue.size(); i++) {
755 prerenders.push_back(prerender_contents_factory() 767 prerenders.push_back(prerender_contents_factory()
756 ->ExpectPrerenderContents(expected_final_status_queue[i])); 768 ->ExpectPrerenderContents(expected_final_status_queue[i]));
757 } 769 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 818 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
807 std::unique_ptr<net::URLRequestInterceptor> interceptor( 819 std::unique_ptr<net::URLRequestInterceptor> interceptor(
808 new HangingFirstRequestInterceptor(file, callback)); 820 new HangingFirstRequestInterceptor(file, callback));
809 net::URLRequestFilter::GetInstance()->AddUrlInterceptor( 821 net::URLRequestFilter::GetInstance()->AddUrlInterceptor(
810 url, std::move(interceptor)); 822 url, std::move(interceptor));
811 } 823 }
812 824
813 } // namespace test_utils 825 } // namespace test_utils
814 826
815 } // namespace prerender 827 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_test_utils.h ('k') | chrome/test/data/prerender/appcache.manifest » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698