summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-15 18:18:51 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-15 18:18:51 +0000
commit94ab2ad56ffee23d84e6c5b89c40a42158241b78 (patch)
tree9bd51f283b554e80d6c0d6a88b7e094d86cb0e4b /chrome/browser
parent86a6ec39a818dc47975c6b0042d80acdfdb70a66 (diff)
downloadchromium_src-94ab2ad56ffee23d84e6c5b89c40a42158241b78.zip
chromium_src-94ab2ad56ffee23d84e6c5b89c40a42158241b78.tar.gz
chromium_src-94ab2ad56ffee23d84e6c5b89c40a42158241b78.tar.bz2
The ParseFeed test was testing too much in one test, hitting the overall limit for a single browser test. I have therefore split it into three and added a more descriptive error message for when we time out.
I will remove the traces and the FLAKY_ label after a successful run or two on the bots. BUG=23686 TEST=Tested by automated test. Review URL: http://codereview.chromium.org/274066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/extensions/extension_browsertests_misc.cc83
1 files changed, 54 insertions, 29 deletions
diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc
index 952bcba..91f488c 100644
--- a/chrome/browser/extensions/extension_browsertests_misc.cc
+++ b/chrome/browser/extensions/extension_browsertests_misc.cc
@@ -309,10 +309,11 @@ void GetParsedFeedData(Browser* browser, std::string* feed_title,
jscript_error, error));
}
-// Tests that we can parse feeds.
-// This test works fine on XP and all Vista machines I've tested it on, but for
-// some reason fails reliably on the Vista bots.
-IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_ParseFeed) {
+
+// Tests that we can parse valid feeds.
+// This test was originally one big test that kept timing out because there is
+// an overall timeout per browser tests. It was then split up into multiple.
+IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_ParseFeedValidFeeds1) {
HTTPTestServer* server = StartHTTPServer();
std::string feed_title;
@@ -321,8 +322,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_ParseFeed) {
std::string error;
std::cout << "Starting test ParseFeed with kValidFeed1.\n";
-
ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, kValidFeed1));
+ std::cout << "GetParseFeedData.\n";
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());
@@ -330,8 +331,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_ParseFeed) {
EXPECT_STREQ("No error", error.c_str());
std::cout << "Moving on to kValidFeed2.\n";
-
ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, kValidFeed2));
+ std::cout << "GetParseFeedData.\n";
GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
EXPECT_STREQ("Feed for 'MyFeed2'", feed_title.c_str());
EXPECT_STREQ("My item title1", item_title.c_str());
@@ -339,8 +340,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_ParseFeed) {
EXPECT_STREQ("No error", error.c_str());
std::cout << "Moving on to kValidFeed3.\n";
-
ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, kValidFeed3));
+ std::cout << "GetParseFeedData.\n";
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());
@@ -348,40 +349,32 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_ParseFeed) {
EXPECT_STREQ("No error", error.c_str());
std::cout << "Moving on to kValidFeed4.\n";
-
// Feed with weird characters in title.
ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, kValidFeed4));
+ std::cout << "GetParseFeedData.\n";
GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
EXPECT_STREQ("Feed for 'Title chars <script> %23 stop'", feed_title.c_str());
EXPECT_STREQ("Title chars <script> %23 stop", item_title.c_str());
EXPECT_STREQ("My dear content", item_desc.c_str());
EXPECT_STREQ("No error", error.c_str());
+}
- std::cout << "Moving on to kInvalidFeed1.\n";
-
- // Try an empty feed.
- ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, kInvalidFeed1));
- GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
- EXPECT_STREQ("Feed for 'Unknown feed name'", feed_title.c_str());
- 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());
-
- std::cout << "Moving on to kInvalidFeed2.\n";
+// Tests that we can parse valid feeds.
+// This test was originally one big test that kept timing out because there is
+// an overall timeout per browser tests. It was then split up into multiple.
+IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_ParseFeedValidFeeds2) {
+ HTTPTestServer* server = StartHTTPServer();
- // Try a garbage feed.
- ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, kInvalidFeed2));
- GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
- EXPECT_STREQ("Feed for 'Unknown feed name'", feed_title.c_str());
- 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());
+ std::string feed_title;
+ std::string item_title;
+ std::string item_desc;
+ std::string error;
std::cout << "Moving on to kValidFeed0.\n";
-
// Try a feed with a link with an onclick handler (before r27440 this would
// trigger a NOTREACHED).
ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, kValidFeed0));
+ std::cout << "GetParseFeedData.\n";
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());
@@ -389,19 +382,51 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_ParseFeed) {
EXPECT_STREQ("No error", error.c_str());
std::cout << "Moving on to kValidFeed5.\n";
-
// Feed with valid but mostly empty xml.
ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, kValidFeed5));
+ std::cout << "GetParseFeedData.\n";
GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
EXPECT_STREQ("Feed for 'Unknown feed name'", feed_title.c_str());
EXPECT_STREQ("element 'anchor_0' not found", item_title.c_str());
EXPECT_STREQ("element 'desc_0' not found", item_desc.c_str());
EXPECT_STREQ("This feed contains no entries.", error.c_str());
+}
- std::cout << "Moving on to foo.xml (doesn't exist).\n";
+// Tests that we can parse invalid feeds.
+// This test was originally one big test that kept timing out because there is
+// an overall timeout per browser tests. It was then split up into multiple.
+IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_ParseFeedInvalidFeeds1) {
+ HTTPTestServer* server = StartHTTPServer();
+ std::string feed_title;
+ std::string item_title;
+ std::string item_desc;
+ std::string error;
+
+ std::cout << "Moving on to kInvalidFeed1.\n";
+ // Try an empty feed.
+ ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, kInvalidFeed1));
+ std::cout << "GetParseFeedData.\n";
+ GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
+ EXPECT_STREQ("Feed for 'Unknown feed name'", feed_title.c_str());
+ 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());
+
+ std::cout << "Moving on to kInvalidFeed2.\n";
+ // Try a garbage feed.
+ ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, kInvalidFeed2));
+ std::cout << "GetParseFeedData.\n";
+ GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
+ EXPECT_STREQ("Feed for 'Unknown feed name'", feed_title.c_str());
+ 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());
+
+ std::cout << "Moving on to foo.xml (doesn't exist).\n";
// Try a feed that doesn't exist.
ui_test_utils::NavigateToURL(browser(), GetFeedUrl(server, L"foo.xml"));
+ std::cout << "GetParseFeedData.\n";
GetParsedFeedData(browser(), &feed_title, &item_title, &item_desc, &error);
EXPECT_STREQ("Feed for 'Unknown feed name'", feed_title.c_str());
EXPECT_STREQ("element 'anchor_0' not found", item_title.c_str());