summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_browsertests_misc.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 23:12:35 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 23:12:35 +0000
commitf5c8a1596de89f2f3010186b03cc2378d23254ae (patch)
tree097e39e5bf01d58f01170d22ae1bd177cd2ca2d9 /chrome/browser/extensions/extension_browsertests_misc.cc
parent0044b810333212dda702cc6e22b042e8331df4fc (diff)
downloadchromium_src-f5c8a1596de89f2f3010186b03cc2378d23254ae.zip
chromium_src-f5c8a1596de89f2f3010186b03cc2378d23254ae.tar.gz
chromium_src-f5c8a1596de89f2f3010186b03cc2378d23254ae.tar.bz2
The RSS extension now renders the RSS HTML preview inside an IFRAME.
BUG=None TEST=See browser tests. Review URL: http://codereview.chromium.org/242055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27562 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_browsertests_misc.cc')
-rw-r--r--chrome/browser/extensions/extension_browsertests_misc.cc28
1 files changed, 24 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc
index 153d0a1..5d4ecdc 100644
--- a/chrome/browser/extensions/extension_browsertests_misc.cc
+++ b/chrome/browser/extensions/extension_browsertests_misc.cc
@@ -295,16 +295,20 @@ void GetParsedFeedData(Browser* browser, std::string* feed_title,
std::string* item_title, std::string* item_desc,
std::string* error) {
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
- browser->GetSelectedTabContents()->render_view_host(), L"",
+ browser->GetSelectedTabContents()->render_view_host(),
+ L"", // Title is on the main page, all the rest is in the IFRAME.
jscript_feed_title, feed_title));
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
- browser->GetSelectedTabContents()->render_view_host(), L"",
+ browser->GetSelectedTabContents()->render_view_host(),
+ L"//html/body/div/iframe[1]",
jscript_anchor, item_title));
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
- browser->GetSelectedTabContents()->render_view_host(), L"",
+ browser->GetSelectedTabContents()->render_view_host(),
+ L"//html/body/div/iframe[1]",
jscript_desc, item_desc));
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
- browser->GetSelectedTabContents()->render_view_host(), L"",
+ browser->GetSelectedTabContents()->render_view_host(),
+ L"//html/body/div/iframe[1]",
jscript_error, error));
}
@@ -329,6 +333,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeed) {
EXPECT_STREQ("This is a summary.", item_desc.c_str());
EXPECT_STREQ("No error", error.c_str());
+ ui_test_utils::NavigateToURL(browser(), GetFeedUrl("feed3.xml"));
+ GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
+ EXPECT_STREQ("Feed for 'Google Code buglist rss feed'", feed_title.c_str());
+ EXPECT_STREQ("My dear title", item_title.c_str());
+ EXPECT_STREQ("My dear content", item_desc.c_str());
+ EXPECT_STREQ("No error", error.c_str());
+
// Try a feed that doesn't exist.
ui_test_utils::NavigateToURL(browser(), GetFeedUrl("feed_nonexistant.xml"));
GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
@@ -352,6 +363,15 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeed) {
EXPECT_STREQ("element 'anchor_0' not found", item_title.c_str());
EXPECT_STREQ("element 'desc_0' not found", item_desc.c_str());
EXPECT_STREQ("Not a valid feed", error.c_str());
+
+ // Try a feed with a link with an onclick handler (before r27440 this would
+ // trigger a NOTREACHED).
+ ui_test_utils::NavigateToURL(browser(), GetFeedUrl("feed_script.xml"));
+ GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
+ EXPECT_STREQ("Feed for 'MyFeedTitle'", feed_title.c_str());
+ EXPECT_STREQ("Title 1", item_title.c_str());
+ EXPECT_STREQ("Desc VIDEO", item_desc.c_str());
+ EXPECT_STREQ("No error", error.c_str());
}
#if defined(OS_WIN) // TODO(port) - enable.