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

Unified Diff: content/browser/browser_url_handler_impl_unittest.cc

Issue 659153003: Add a unit test for viewsource reverse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@viewsource
Patch Set: add some comments Created 6 years, 2 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
« no previous file with comments | « content/browser/browser_url_handler_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_url_handler_impl_unittest.cc
diff --git a/content/browser/browser_url_handler_impl_unittest.cc b/content/browser/browser_url_handler_impl_unittest.cc
index 4e8dc2115fdf3617b43feb82b1d11e991c4e44fd..daceffcee4720da29ec6d5704f531cda5829916c 100644
--- a/content/browser/browser_url_handler_impl_unittest.cc
+++ b/content/browser/browser_url_handler_impl_unittest.cc
@@ -79,4 +79,19 @@ TEST_F(BrowserURLHandlerImplTest, NullHandlerReverse) {
ASSERT_EQ("foo://foo", url.spec());
}
+// Verify that the reverse handler for view-source does not duplicate query
+// parameters.
+TEST_F(BrowserURLHandlerImplTest, ViewSourceReverse) {
+ TestBrowserContext browser_context;
+ BrowserURLHandlerImpl handler;
+
+ GURL url("http://foo/?a=1");
+ GURL original_url("view-source:http://some_url");
+ bool reversed = handler.ReverseURLRewrite(&url,
+ original_url,
+ &browser_context);
+ ASSERT_TRUE(reversed);
+ ASSERT_EQ("view-source:http://foo/?a=1", url.spec());
+}
+
} // namespace content
« no previous file with comments | « content/browser/browser_url_handler_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698