summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/extension_browsertests_misc.cc20
-rw-r--r--chrome/test/data/extensions/subscribe_page_action/feed_finder.js6
-rw-r--r--chrome/test/data/extensions/subscribe_page_action/manifest.json2
-rw-r--r--chrome/test/data/feeds/feed_multi_rel.html8
4 files changed, 32 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc
index b6c3da8..2691a67 100644
--- a/chrome/browser/extensions/extension_browsertests_misc.cc
+++ b/chrome/browser/extensions/extension_browsertests_misc.cc
@@ -31,6 +31,7 @@
const std::wstring kSubscribePage =
L"files/extensions/subscribe_page_action/subscribe.html";
const std::wstring kFeedPage = L"files/feeds/feed.html";
+const std::wstring kFeedPageMultiRel = L"files/feeds/feed_multi_rel.html";
const std::wstring kNoFeedPage = L"files/feeds/no_feed.html";
const std::wstring kValidFeed0 = L"files/feeds/feed_script.xml";
const std::wstring kValidFeed1 = L"files/feeds/feed1.xml";
@@ -204,11 +205,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TabContents) {
// keep these from working
#define MAYBE_PageAction DISABLED_PageAction
#define MAYBE_UnloadPageAction DISABLED_UnloadPageAction
+#define MAYBE_RSSMultiRelLink DISABLED_RSSMultiRelLink
#define MAYBE_TitleLocalizationBrowserAction DISABLED_TitleLocalizationBrowserAction
#define MAYBE_TitleLocalizationPageAction DISABLED_TitleLocalizationPageAction
#else
#define MAYBE_PageAction PageAction
#define MAYBE_UnloadPageAction UnloadPageAction
+#define MAYBE_RSSMultiRelLink RSSMultiRelLink
#define MAYBE_TitleLocalizationBrowserAction TitleLocalizationBrowserAction
#define MAYBE_TitleLocalizationPageAction TitleLocalizationPageAction
#endif
@@ -259,6 +262,23 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_UnloadPageAction) {
ASSERT_TRUE(WaitForPageActionCountChangeTo(0));
}
+// Makes sure that the RSS detects RSS feed links, even when rel tag contains
+// more than just "alternate".
+IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_RSSMultiRelLink) {
+ HTTPTestServer* server = StartHTTPServer();
+
+ ASSERT_TRUE(LoadExtension(
+ test_data_dir_.AppendASCII("subscribe_page_action")));
+
+ ASSERT_TRUE(WaitForPageActionVisibilityChangeTo(0));
+
+ // Navigate to the feed page.
+ GURL feed_url = server->TestServerPageW(kFeedPageMultiRel);
+ ui_test_utils::NavigateToURL(browser(), feed_url);
+ // We should now have one page action ready to go in the LocationBar.
+ ASSERT_TRUE(WaitForPageActionVisibilityChangeTo(1));
+}
+
// Tests that tooltips of a browser action icon can be specified using UTF8.
// See http://crbug.com/25349.
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_TitleLocalizationBrowserAction) {
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 9a77ff2..14b0eb9 100644
--- a/chrome/test/data/extensions/subscribe_page_action/feed_finder.js
+++ b/chrome/test/data/extensions/subscribe_page_action/feed_finder.js
@@ -19,9 +19,9 @@ if (!isFeedDocument()) {
function findFeedLinks() {
// Find all the RSS link elements.
var result = document.evaluate(
- '//*[local-name()="link"][@rel="alternate"][contains(@type, "rss") or ' +
- 'contains(@type, "atom") or contains(@type, "rdf")]',
- document, null, 0, null);
+ '//*[local-name()="link"][contains(@rel, "alternate")] ' +
+ '[contains(@type, "rss") or contains(@type, "atom") or ' +
+ 'contains(@type, "rdf")]', document, null, 0, null);
var feeds = [];
var item;
diff --git a/chrome/test/data/extensions/subscribe_page_action/manifest.json b/chrome/test/data/extensions/subscribe_page_action/manifest.json
index 5e28a38..ae87991 100644
--- a/chrome/test/data/extensions/subscribe_page_action/manifest.json
+++ b/chrome/test/data/extensions/subscribe_page_action/manifest.json
@@ -20,5 +20,5 @@
"popup": "popup.html"
},
"permissions": [ "tabs", "http://*/*", "https://*/*" ],
- "version": "2.0.1"
+ "version": "2.0.2"
}
diff --git a/chrome/test/data/feeds/feed_multi_rel.html b/chrome/test/data/feeds/feed_multi_rel.html
new file mode 100644
index 0000000..ac1dea9
--- /dev/null
+++ b/chrome/test/data/feeds/feed_multi_rel.html
@@ -0,0 +1,8 @@
+<html>
+<head>
+ <link rel="updates alternate" type="application/rss+xml" title="RSS" href="feed1.xml"/>
+</head>
+<body>
+ This is a page with a feed link containing multiple rel entries.
+</body>
+</html>