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

Unified Diff: chrome/browser/browser_about_handler_unittest.cc

Issue 923183003: Move URL fixup to a preliminary phase that doesn't affect virtual URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to BrowserURLHandler Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browser_about_handler_unittest.cc
diff --git a/chrome/browser/browser_about_handler_unittest.cc b/chrome/browser/browser_about_handler_unittest.cc
index 2754d4948814b12395d16a0ac895cef3f6904f7a..2448653ab24c3e07bfe12580c0d6957945ee5a92 100644
--- a/chrome/browser/browser_about_handler_unittest.cc
+++ b/chrome/browser/browser_about_handler_unittest.cc
@@ -8,11 +8,17 @@
#include "chrome/browser/browser_about_handler.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/navigation_controller.h"
+#include "content/public/browser/navigation_entry.h"
+#include "content/public/common/referrer.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
using content::BrowserThread;
+using content::NavigationController;
+using content::NavigationEntry;
+using content::Referrer;
typedef testing::Test BrowserAboutHandlerTest;
@@ -74,3 +80,24 @@ TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURL) {
EXPECT_EQ(test_data[i].result_url, url);
}
}
+
+// Ensure that minor BrowserAboutHandler fixup to a URL does not cause us to
+// keep a separate virtual URL, which would not be updated on redirects.
+// See https://crbug.com/449829.
+TEST_F(BrowserAboutHandlerTest, NoVirtualURLForFixup) {
+ GURL url("view-source:http://.foo");
+
+ // Fixup will remove the dot and add a slash.
+ GURL fixed_url("view-source:http://foo/");
+
+ // Rewriters will remove the view-source prefix and expect it to stay in the
+ // virtual URL.
+ GURL rewritten_url("http://foo/");
+
+ TestingProfile profile;
+ scoped_ptr<NavigationEntry> entry(NavigationController::CreateNavigationEntry(
+ url, Referrer(), ui::PAGE_TRANSITION_RELOAD, false, std::string(),
+ &profile));
+ EXPECT_EQ(fixed_url, entry->GetVirtualURL());
+ EXPECT_EQ(rewritten_url, entry->GetURL());
+}

Powered by Google App Engine
This is Rietveld 408576698