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

Side by Side Diff: webkit/glue/dom_operations_unittest.cc

Issue 10387090: Pass the referrer policy with the referrer for the save package code path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« webkit/glue/dom_operations.h ('K') | « webkit/glue/dom_operations.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/file_util.h" 5 #include "base/file_util.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "net/base/net_util.h" 9 #include "net/base/net_util.h"
10 #include "net/url_request/url_request_context.h" 10 #include "net/url_request/url_request_context.h"
(...skipping 28 matching lines...) Expand all
39 const FilePath& page_file_path, 39 const FilePath& page_file_path,
40 const std::set<GURL>& expected_resources_set) { 40 const std::set<GURL>& expected_resources_set) {
41 // Convert local file path to file URL. 41 // Convert local file path to file URL.
42 GURL file_url = net::FilePathToFileURL(page_file_path); 42 GURL file_url = net::FilePathToFileURL(page_file_path);
43 // Load the test file. 43 // Load the test file.
44 test_shell_->ResetTestController(); 44 test_shell_->ResetTestController();
45 test_shell_->LoadURL(file_url); 45 test_shell_->LoadURL(file_url);
46 test_shell_->WaitTestFinished(); 46 test_shell_->WaitTestFinished();
47 // Get all savable resource links for the page. 47 // Get all savable resource links for the page.
48 std::vector<GURL> resources_list; 48 std::vector<GURL> resources_list;
49 std::vector<GURL> referrers_list; 49 std::vector<GURL> referrer_urls_list;
50 std::vector<WebKit::WebReferrerPoliciy> referrer_policies_list;
50 std::vector<GURL> frames_list; 51 std::vector<GURL> frames_list;
51 webkit_glue::SavableResourcesResult result(&resources_list, 52 webkit_glue::SavableResourcesResult result(&resources_list,
52 &referrers_list, 53 &referrer_urls_list,
54 &referrer_policies_list,
53 &frames_list); 55 &frames_list);
54 56
55 const char* savable_schemes[] = { 57 const char* savable_schemes[] = {
56 "http", 58 "http",
57 "https", 59 "https",
58 "file", 60 "file",
59 NULL 61 NULL
60 }; 62 };
61 63
62 ASSERT_TRUE(webkit_glue::GetAllSavableResourceLinksForCurrentPage( 64 ASSERT_TRUE(webkit_glue::GetAllSavableResourceLinksForCurrentPage(
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 page_file_path.AppendASCII(expected_frame_links[i]); 124 page_file_path.AppendASCII(expected_frame_links[i]);
123 expected_resources_set.insert( 125 expected_resources_set.insert(
124 net::FilePathToFileURL(expected_frame_url)); 126 net::FilePathToFileURL(expected_frame_url));
125 } 127 }
126 128
127 page_file_path = page_file_path.AppendASCII("youtube_2.htm"); 129 page_file_path = page_file_path.AppendASCII("youtube_2.htm");
128 GetSavableResourceLinksForPage(page_file_path, expected_resources_set); 130 GetSavableResourceLinksForPage(page_file_path, expected_resources_set);
129 } 131 }
130 132
131 } // namespace 133 } // namespace
OLDNEW
« webkit/glue/dom_operations.h ('K') | « webkit/glue/dom_operations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698