summaryrefslogtreecommitdiffstats
path: root/chrome/browser/find_in_page_controller_uitest.cc
diff options
context:
space:
mode:
authorfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-27 19:11:56 +0000
committerfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-27 19:11:56 +0000
commit968efff76e72340022169b518c04e9cfbf2f8fb5 (patch)
tree64598687bd7229b6e3adeba66090782bd124aa8f /chrome/browser/find_in_page_controller_uitest.cc
parent49df6028b6d82773f3bf62dfabd1abcbe0207f21 (diff)
downloadchromium_src-968efff76e72340022169b518c04e9cfbf2f8fb5.zip
chromium_src-968efff76e72340022169b518c04e9cfbf2f8fb5.tar.gz
chromium_src-968efff76e72340022169b518c04e9cfbf2f8fb5.tar.bz2
Adding a test to make sure Find restarts properly after a timeout.
BUG=1155639 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/find_in_page_controller_uitest.cc')
-rw-r--r--chrome/browser/find_in_page_controller_uitest.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/find_in_page_controller_uitest.cc b/chrome/browser/find_in_page_controller_uitest.cc
index d8e722a..2845c07 100644
--- a/chrome/browser/find_in_page_controller_uitest.cc
+++ b/chrome/browser/find_in_page_controller_uitest.cc
@@ -17,6 +17,7 @@ class FindInPageControllerTest : public UITest {
const std::wstring kFramePage = L"files/find_in_page/frames.html";
const std::wstring kUserSelectPage = L"files/find_in_page/user-select.html";
const std::wstring kCrashPage = L"files/find_in_page/crash_1341577.html";
+const std::wstring kTooFewMatchesPage = L"files/find_in_page/bug_1155639.html";
// This test loads a page with frames and starts FindInPage requests
TEST_F(FindInPageControllerTest, FindInPageFrames) {
@@ -95,3 +96,23 @@ TEST_F(FindInPageControllerTest, DISABLED_FindCrash_Issue1341577) {
EXPECT_EQ(1, tab->FindInPage(L"\u0D24\u0D46", FWD, IGNORE_CASE, false));
EXPECT_EQ(0, tab->FindInPage(L"nostring", FWD, IGNORE_CASE, false));
}
+
+// Test to make sure Find does the right thing when restarting from a timeout.
+// We used to have a problem where we'd stop finding matches when all of the
+// following conditions were true:
+// 1) The page has a lot of text to search.
+// 2) The page contains more than one match.
+// 3) It takes longer than the time-slice given to each Find operation (100
+// ms) to find one or more of those matches (so Find times out and has to try
+// again from where it left off).
+TEST_F(FindInPageControllerTest, FindEnoughMatches_Issue1341577) {
+ TestServer server(L"chrome/test/data");
+
+ GURL url = server.TestServerPageW(kTooFewMatchesPage);
+ scoped_ptr<TabProxy> tab(GetActiveTab());
+ ASSERT_TRUE(tab->NavigateToURL(url));
+
+ // This string appears 5 times at the bottom of a long page. If Find restarts
+ // properly after a timeout, it will find 5 matches, not just 1.
+ EXPECT_EQ(5, tab->FindInPage(L"008.xml", FWD, IGNORE_CASE, false));
+}