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

Unified Diff: chrome/browser/extensions/extension_browsertests_misc.cc

Issue 6332008: The RSS subscribe.js should not double-decoded the URL passed in.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « no previous file | chrome/test/data/extensions/subscribe_page_action/subscribe.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_browsertests_misc.cc
===================================================================
--- chrome/browser/extensions/extension_browsertests_misc.cc (revision 71771)
+++ chrome/browser/extensions/extension_browsertests_misc.cc (working copy)
@@ -50,6 +50,10 @@
const std::string kInvalidFeed2 = "files/feeds/feed_invalid2.xml";
const std::string kLocalization =
"files/extensions/browsertest/title_localized_pa/simple.html";
+// We need a triple encoded string to prove that we are not decoding twice in
+// subscribe.js because one layer is also stripped off when subscribe.js passes
+// it to the XMLHttpRequest object.
+const std::string kFeedTripleEncoded = "files/feeds/url%25255Fdecoding.html";
const std::string kHashPageA =
"files/extensions/api_test/page_action/hash_change/test_page_A.html";
const std::string kHashPageAHash = kHashPageA + "#asdf";
@@ -622,6 +626,26 @@
"This feed contains no entries.");
}
+IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedInvalidFeed4) {
+ ASSERT_TRUE(test_server()->Start());
+
+ ASSERT_TRUE(LoadExtension(
+ test_data_dir_.AppendASCII("subscribe_page_action")));
+
+ // subscribe.js shouldn't double-decode the URL passed in. Otherwise feed
+ // links such as http://search.twitter.com/search.atom?lang=en&q=%23chrome
+ // will result in no feed being downloaded because %23 gets decoded to # and
+ // therefore #chrome is not treated as part of the Twitter query. This test
+ // uses an underscore instead of a hash, but the principle is the same. If
+ // we start erroneously double decoding again, the path (and the feed) will
+ // become valid resulting in a failure for this test.
+ NavigateToFeedAndValidate(test_server(), kFeedTripleEncoded, browser(), true,
+ "Feed for Unknown feed name",
+ "element 'anchor_0' not found",
+ "element 'desc_0' not found",
+ "This feed contains no entries.");
+}
+
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeedNoLinks) {
ASSERT_TRUE(test_server()->Start());
« no previous file with comments | « no previous file | chrome/test/data/extensions/subscribe_page_action/subscribe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698