summaryrefslogtreecommitdiffstats
path: root/chrome/test/data
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-18 23:05:13 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-18 23:05:13 +0000
commit5510cff445f38b167c8ca9c734e9311fd0505212 (patch)
tree1ed94fc5ce951c60b8feaf313a948f4e80052e40 /chrome/test/data
parent0d7e8811d119932473dcb7f11632ee4972d19cb6 (diff)
downloadchromium_src-5510cff445f38b167c8ca9c734e9311fd0505212.zip
chromium_src-5510cff445f38b167c8ca9c734e9311fd0505212.tar.gz
chromium_src-5510cff445f38b167c8ca9c734e9311fd0505212.tar.bz2
Ignore the namespace while detecting RSS feed to fix issues with no RSS being found on pages with content type application/xhtml+xml.
I also now force the mime type to be text/xml for all feeds so that servers who return incorrect mime-type don't trip up the XML parsing in handleResponse. BUG=None TEST=A feed should be detected on pages such as cielonegro dot org. Review URL: http://codereview.chromium.org/536088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data')
-rw-r--r--chrome/test/data/extensions/subscribe_page_action/feed_finder.js5
-rw-r--r--chrome/test/data/extensions/subscribe_page_action/manifest.json2
-rw-r--r--chrome/test/data/extensions/subscribe_page_action/subscribe.js6
3 files changed, 8 insertions, 5 deletions
diff --git a/chrome/test/data/extensions/subscribe_page_action/feed_finder.js b/chrome/test/data/extensions/subscribe_page_action/feed_finder.js
index 218bcd0..af265c1 100644
--- a/chrome/test/data/extensions/subscribe_page_action/feed_finder.js
+++ b/chrome/test/data/extensions/subscribe_page_action/feed_finder.js
@@ -1,14 +1,13 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
findFeeds();
-window.addEventListener("focus", findFeeds);
function findFeeds() {
// Find all the RSS link elements.
var result = document.evaluate(
- '//link[@rel="alternate"][contains(@type, "rss") or ' +
+ '//*[local-name()="link"][@rel="alternate"][contains(@type, "rss") or ' +
'contains(@type, "atom") or contains(@type, "rdf")]',
document, null, 0, null);
diff --git a/chrome/test/data/extensions/subscribe_page_action/manifest.json b/chrome/test/data/extensions/subscribe_page_action/manifest.json
index fe81730..be13375 100644
--- a/chrome/test/data/extensions/subscribe_page_action/manifest.json
+++ b/chrome/test/data/extensions/subscribe_page_action/manifest.json
@@ -1,7 +1,7 @@
{
"name": "RSS Subscription Extension (by Google)",
"description": "Adds one-click subscription to your toolbar.",
- "version": "1.9",
+ "version": "1.9.1",
"permissions": [
"tabs",
"http://*/*",
diff --git a/chrome/test/data/extensions/subscribe_page_action/subscribe.js b/chrome/test/data/extensions/subscribe_page_action/subscribe.js
index d1f322d..6234dfa 100644
--- a/chrome/test/data/extensions/subscribe_page_action/subscribe.js
+++ b/chrome/test/data/extensions/subscribe_page_action/subscribe.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -107,6 +107,10 @@ function main() {
feedUrl = decodeURIComponent(feedUrl);
req.onload = handleResponse;
req.onerror = handleError;
+ // Not everyone sets the mime type correctly, which causes handleResponse
+ // to fail to XML parse the response text from the server. By forcing
+ // it to text/xml we avoid this.
+ req.overrideMimeType('text/xml');
req.open("GET", feedUrl, !synchronousRequest);
req.send(null);