Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
|
darin (slow to review)
2014/03/27 08:10:28
nit: Please drop the "(c)" from the header. We use
hush (inactive)
2014/03/27 20:15:00
Done.
| |
| 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/shell/browser/shell.h" | |
| 10 #include "content/test/content_browser_test.h" | |
| 11 #include "content/test/content_browser_test_utils.h" | |
| 12 | |
| 13 namespace content { | |
|
darin (slow to review)
2014/03/27 08:10:28
nit: add a new line here between the namespace and
hush (inactive)
2014/03/27 20:15:00
Done.
| |
| 14 class NavigationControllerBrowserTest : public ContentBrowserTest { | |
| 15 }; | |
| 16 | |
| 17 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, LoadDataWithBaseURL) { | |
| 18 const GURL base_url("http://baseurl"); | |
| 19 const GURL history_url("http://historyurl"); | |
| 20 const std::string data = "<html><body>foo</body></html>"; | |
| 21 | |
| 22 NavigationController& controller = shell()->web_contents()->GetController(); | |
|
darin (slow to review)
2014/03/27 08:10:28
nit: We generally avoid non-const references in Ch
hush (inactive)
2014/03/27 20:15:00
Done.
| |
| 23 // load data. Blocks until it is done. | |
| 24 content::LoadDataWithBaseURL(shell(), base_url, data, history_url); | |
| 25 | |
| 26 // We should use history_url instead of the base_url as the original url of | |
| 27 // this navigation entry, because base_url is only used for resolving relative | |
| 28 // paths in the data, or enforcing same origin policy. | |
| 29 EXPECT_EQ(controller.GetVisibleEntry()->GetOriginalRequestURL(), history_url); | |
| 30 } | |
| 31 } // namespace content | |
|
darin (slow to review)
2014/03/27 08:10:28
nit: add a new line above here.
hush (inactive)
2014/03/27 20:15:00
Done.
| |
| OLD | NEW |