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

Side by Side Diff: content/test/test_render_frame_host.cc

Issue 1457053004: Fix in-page logic for allow_universal_access_from_files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes from review Created 5 years, 1 month 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
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/test/test_render_frame_host.h" 5 #include "content/test/test_render_frame_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/frame_host/frame_tree.h" 8 #include "content/browser/frame_host/frame_tree.h"
9 #include "content/browser/frame_host/navigation_handle_impl.h" 9 #include "content/browser/frame_host/navigation_handle_impl.h"
10 #include "content/browser/frame_host/navigation_request.h" 10 #include "content/browser/frame_host/navigation_request.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 params.did_create_new_entry = did_create_new_entry; 279 params.did_create_new_entry = did_create_new_entry;
280 params.gesture = NavigationGestureUser; 280 params.gesture = NavigationGestureUser;
281 params.contents_mime_type = contents_mime_type_; 281 params.contents_mime_type = contents_mime_type_;
282 params.is_post = false; 282 params.is_post = false;
283 params.http_status_code = response_code; 283 params.http_status_code = response_code;
284 params.socket_address.set_host("2001:db8::1"); 284 params.socket_address.set_host("2001:db8::1");
285 params.socket_address.set_port(80); 285 params.socket_address.set_port(80);
286 params.history_list_was_cleared = simulate_history_list_was_cleared_; 286 params.history_list_was_cleared = simulate_history_list_was_cleared_;
287 params.original_request_url = url_copy; 287 params.original_request_url = url_copy;
288 288
289 // In most cases, the origin will match the URL's origin. Tests that need to
290 // check corner cases (like about:blank) should specify the origin param
291 // manually.
292 url::Origin origin(url_copy);
293 params.origin = origin;
294
289 url::Replacements<char> replacements; 295 url::Replacements<char> replacements;
290 replacements.ClearRef(); 296 replacements.ClearRef();
291 params.was_within_same_page = 297 params.was_within_same_page =
292 transition != ui::PAGE_TRANSITION_RELOAD && 298 transition != ui::PAGE_TRANSITION_RELOAD &&
293 transition != ui::PAGE_TRANSITION_TYPED && 299 transition != ui::PAGE_TRANSITION_TYPED &&
294 url_copy.ReplaceComponents(replacements) == 300 url_copy.ReplaceComponents(replacements) ==
295 GetLastCommittedURL().ReplaceComponents(replacements); 301 GetLastCommittedURL().ReplaceComponents(replacements);
296 302
297 params.page_state = 303 params.page_state =
298 PageState::CreateForTesting(url_copy, false, nullptr, nullptr); 304 PageState::CreateForTesting(url_copy, false, nullptr, nullptr);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 // cleared during DidFailProvisionalLoad). 409 // cleared during DidFailProvisionalLoad).
404 int page_id = entry ? entry->GetPageID() : -1; 410 int page_id = entry ? entry->GetPageID() : -1;
405 if (page_id == -1) { 411 if (page_id == -1) {
406 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); 412 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate());
407 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; 413 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1;
408 } 414 }
409 return page_id; 415 return page_id;
410 } 416 }
411 417
412 } // namespace content 418 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698