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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl_browsertest.cc

Issue 176883012: Set the original url correctly if the frame is loaded via loadData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase correctly Created 6 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
« no previous file with comments | « no previous file | content/content_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/bind.h"
6 #include "content/browser/frame_host/navigation_controller_impl.h"
7 #include "content/browser/frame_host/navigation_entry_impl.h"
8 #include "content/public/browser/web_contents.h"
9 #include "content/public/test/content_browser_test.h"
10 #include "content/public/test/content_browser_test_utils.h"
11 #include "content/shell/browser/shell.h"
12
13 namespace content {
14
15 class NavigationControllerBrowserTest : public ContentBrowserTest {
16 };
17
18 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, LoadDataWithBaseURL) {
19 const GURL base_url("http://baseurl");
20 const GURL history_url("http://historyurl");
21 const std::string data = "<html><body>foo</body></html>";
22
23 const NavigationController& controller =
24 shell()->web_contents()->GetController();
25 // load data. Blocks until it is done.
26 content::LoadDataWithBaseURL(shell(), history_url, data, base_url);
27
28 // We should use history_url instead of the base_url as the original url of
29 // this navigation entry, because base_url is only used for resolving relative
30 // paths in the data, or enforcing same origin policy.
31 EXPECT_EQ(controller.GetVisibleEntry()->GetOriginalRequestURL(), history_url);
32 }
33 } // namespace content
34
OLDNEW
« no previous file with comments | « no previous file | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698