| Index: chrome/browser/views/find_bar_host_browsertest.cc
|
| ===================================================================
|
| --- chrome/browser/views/find_bar_host_browsertest.cc (revision 27722)
|
| +++ chrome/browser/views/find_bar_host_browsertest.cc (working copy)
|
| @@ -28,62 +28,12 @@
|
| const std::wstring kMoveIfOver = L"files/find_in_page/move_if_obscuring.html";
|
| const std::wstring kBitstackCrash = L"files/find_in_page/crash_14491.html";
|
|
|
| -namespace {
|
| +const bool kBack = false;
|
| +const bool kFwd = true;
|
|
|
| -class FindInPageNotificationObserver : public NotificationObserver {
|
| - public:
|
| - explicit FindInPageNotificationObserver(TabContents* parent_tab)
|
| - : parent_tab_(parent_tab),
|
| - active_match_ordinal_(-1),
|
| - number_of_matches_(0) {
|
| - current_find_request_id_ = parent_tab->current_find_request_id();
|
| - registrar_.Add(this, NotificationType::FIND_RESULT_AVAILABLE,
|
| - Source<TabContents>(parent_tab_));
|
| - ui_test_utils::RunMessageLoop();
|
| - }
|
| +const bool kIgnoreCase = false;
|
| +const bool kCaseSensitive = true;
|
|
|
| - int active_match_ordinal() const { return active_match_ordinal_; }
|
| -
|
| - int number_of_matches() const { return number_of_matches_; }
|
| -
|
| - virtual void Observe(NotificationType type, const NotificationSource& source,
|
| - const NotificationDetails& details) {
|
| - if (type == NotificationType::FIND_RESULT_AVAILABLE) {
|
| - Details<FindNotificationDetails> find_details(details);
|
| - if (find_details->request_id() == current_find_request_id_) {
|
| - // We get multiple responses and one of those will contain the ordinal.
|
| - // This message comes to us before the final update is sent.
|
| - if (find_details->active_match_ordinal() > -1)
|
| - active_match_ordinal_ = find_details->active_match_ordinal();
|
| - if (find_details->final_update()) {
|
| - number_of_matches_ = find_details->number_of_matches();
|
| - MessageLoopForUI::current()->Quit();
|
| - } else {
|
| - DLOG(INFO) << "Ignoring, since we only care about the final message";
|
| - }
|
| - }
|
| - } else {
|
| - NOTREACHED();
|
| - }
|
| - }
|
| -
|
| - private:
|
| - NotificationRegistrar registrar_;
|
| - TabContents* parent_tab_;
|
| - // We will at some point (before final update) be notified of the ordinal and
|
| - // we need to preserve it so we can send it later.
|
| - int active_match_ordinal_;
|
| - int number_of_matches_;
|
| - // The id of the current find request, obtained from TabContents. Allows us
|
| - // to monitor when the search completes.
|
| - int current_find_request_id_;
|
| -};
|
| -
|
| -} // namespace
|
| -
|
| -typedef enum { BACK = 0, FWD = 1 } FindInPageDirection;
|
| -typedef enum { IGNORE_CASE = 0, CASE_SENSITIVE = 1 } FindInPageCase;
|
| -
|
| class FindInPageControllerTest : public InProcessBrowserTest {
|
| public:
|
| FindInPageControllerTest() {
|
| @@ -91,21 +41,6 @@
|
| }
|
|
|
| protected:
|
| - int FindInPage(const std::wstring& search_string,
|
| - FindInPageDirection forward,
|
| - FindInPageCase match_case,
|
| - int* ordinal) {
|
| - TabContents* tab_contents = browser()->GetSelectedTabContents();
|
| - tab_contents->StartFinding(search_string, forward == FWD,
|
| - match_case == CASE_SENSITIVE);
|
| -
|
| - FindInPageNotificationObserver observer =
|
| - FindInPageNotificationObserver(tab_contents);
|
| - if (ordinal)
|
| - *ordinal = observer.active_match_ordinal();
|
| - return observer.number_of_matches();
|
| - }
|
| -
|
| void GetFindBarWindowInfo(gfx::Point* position, bool* fully_visible) {
|
| FindBarTesting* find_bar =
|
| browser()->find_bar()->find_bar()->GetFindBarTesting();
|
| @@ -123,55 +58,73 @@
|
|
|
| // Try incremental search (mimicking user typing in).
|
| int ordinal = 0;
|
| - EXPECT_EQ(18, FindInPage(L"g", FWD, IGNORE_CASE, &ordinal));
|
| + TabContents* tab = browser()->GetSelectedTabContents();
|
| + EXPECT_EQ(18, ui_test_utils::FindInPage(tab, L"g",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(11, FindInPage(L"go", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(11, ui_test_utils::FindInPage(tab, L"go",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(04, FindInPage(L"goo", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(04, ui_test_utils::FindInPage(tab, L"goo",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(03, FindInPage(L"goog", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(03, ui_test_utils::FindInPage(tab, L"goog",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(02, FindInPage(L"googl", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(02, ui_test_utils::FindInPage(tab, L"googl",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(01, FindInPage(L"google", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(01, ui_test_utils::FindInPage(tab, L"google",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(00, FindInPage(L"google!", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(00, ui_test_utils::FindInPage(tab, L"google!",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
|
|
| // Negative test (no matches should be found).
|
| - EXPECT_EQ(0, FindInPage(L"Non-existing string", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(tab, L"Non-existing string",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
|
|
| // 'horse' only exists in the three right frames.
|
| - EXPECT_EQ(3, FindInPage(L"horse", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(3, ui_test_utils::FindInPage(tab, L"horse",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
|
|
| // 'cat' only exists in the first frame.
|
| - EXPECT_EQ(1, FindInPage(L"cat", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab, L"cat",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
|
|
| // Try searching again, should still come up with 1 match.
|
| - EXPECT_EQ(1, FindInPage(L"cat", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab, L"cat",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
|
|
| // Try searching backwards, ignoring case, should still come up with 1 match.
|
| - EXPECT_EQ(1, FindInPage(L"CAT", BACK, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab, L"CAT",
|
| + kBack, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
|
|
| // Try case sensitive, should NOT find it.
|
| - EXPECT_EQ(0, FindInPage(L"CAT", FWD, CASE_SENSITIVE, &ordinal));
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(tab, L"CAT",
|
| + kFwd, kCaseSensitive, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
|
|
| // Try again case sensitive, but this time with right case.
|
| - EXPECT_EQ(1, FindInPage(L"dog", FWD, CASE_SENSITIVE, &ordinal));
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab, L"dog",
|
| + kFwd, kCaseSensitive, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
|
|
| // Try non-Latin characters ('Hreggvidur' with 'eth' for 'd' in left frame).
|
| - EXPECT_EQ(1, FindInPage(L"Hreggvi\u00F0ur", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab, L"Hreggvi\u00F0ur",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(1, FindInPage(L"Hreggvi\u00F0ur", FWD, CASE_SENSITIVE, &ordinal));
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab, L"Hreggvi\u00F0ur",
|
| + kFwd, kCaseSensitive, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(0, FindInPage(L"hreggvi\u00F0ur", FWD, CASE_SENSITIVE, &ordinal));
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(tab, L"hreggvi\u00F0ur",
|
| + kFwd, kCaseSensitive, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
| }
|
|
|
| @@ -203,7 +156,8 @@
|
|
|
| // Search for a text that exists within a link on the page.
|
| int ordinal = 0;
|
| - EXPECT_EQ(1, FindInPage(L"nk", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab_contents, L"nk",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
|
|
| // End the find session, which should set focus to the link.
|
| @@ -213,7 +167,8 @@
|
| EXPECT_STREQ("link1", FocusedOnPage(tab_contents).c_str());
|
|
|
| // Search for a text that exists within a link on the page.
|
| - EXPECT_EQ(1, FindInPage(L"Google", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab_contents, L"Google",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
|
|
| // Move the selection to link 1, after searching.
|
| @@ -242,23 +197,31 @@
|
|
|
| // Search for 'o', which should make the first item active and return
|
| // '1 in 3' (1st ordinal of a total of 3 matches).
|
| + TabContents* tab = browser()->GetSelectedTabContents();
|
| int ordinal = 0;
|
| - EXPECT_EQ(3, FindInPage(L"o", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(3, ui_test_utils::FindInPage(tab, L"o",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(3, FindInPage(L"o", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(3, ui_test_utils::FindInPage(tab, L"o",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(2, ordinal);
|
| - EXPECT_EQ(3, FindInPage(L"o", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(3, ui_test_utils::FindInPage(tab, L"o",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(3, ordinal);
|
| // Go back one match.
|
| - EXPECT_EQ(3, FindInPage(L"o", BACK, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(3, ui_test_utils::FindInPage(tab, L"o",
|
| + kBack, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(2, ordinal);
|
| - EXPECT_EQ(3, FindInPage(L"o", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(3, ui_test_utils::FindInPage(tab, L"o",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(3, ordinal);
|
| // This should wrap to the top.
|
| - EXPECT_EQ(3, FindInPage(L"o", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(3, ui_test_utils::FindInPage(tab, L"o",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| // This should go back to the end.
|
| - EXPECT_EQ(3, FindInPage(L"o", BACK, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(3, ui_test_utils::FindInPage(tab, L"o",
|
| + kBack, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(3, ordinal);
|
| }
|
|
|
| @@ -273,31 +236,43 @@
|
|
|
| // Search for 'a', which should make the first item active and return
|
| // '1 in 7' (1st ordinal of a total of 7 matches).
|
| + TabContents* tab = browser()->GetSelectedTabContents();
|
| int ordinal = 0;
|
| - EXPECT_EQ(7, FindInPage(L"a", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(7, FindInPage(L"a", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(2, ordinal);
|
| - EXPECT_EQ(7, FindInPage(L"a", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(3, ordinal);
|
| - EXPECT_EQ(7, FindInPage(L"a", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(4, ordinal);
|
| // Go back one, which should go back one frame.
|
| - EXPECT_EQ(7, FindInPage(L"a", BACK, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kBack, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(3, ordinal);
|
| - EXPECT_EQ(7, FindInPage(L"a", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(4, ordinal);
|
| - EXPECT_EQ(7, FindInPage(L"a", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(5, ordinal);
|
| - EXPECT_EQ(7, FindInPage(L"a", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(6, ordinal);
|
| - EXPECT_EQ(7, FindInPage(L"a", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(7, ordinal);
|
| // Now we should wrap back to frame 1.
|
| - EXPECT_EQ(7, FindInPage(L"a", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| // Now we should wrap back to frame last frame.
|
| - EXPECT_EQ(7, FindInPage(L"a", BACK, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(7,
|
| + ui_test_utils::FindInPage(tab, L"a", kBack, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(7, ordinal);
|
| }
|
|
|
| @@ -312,17 +287,23 @@
|
|
|
| // Search for 'goa' three times (6 matches on page).
|
| int ordinal = 0;
|
| - EXPECT_EQ(6, FindInPage(L"goa", FWD, IGNORE_CASE, &ordinal));
|
| + TabContents* tab = browser()->GetSelectedTabContents();
|
| + EXPECT_EQ(6, ui_test_utils::FindInPage(tab, L"goa",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(6, FindInPage(L"goa", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(6, ui_test_utils::FindInPage(tab, L"goa",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(2, ordinal);
|
| - EXPECT_EQ(6, FindInPage(L"goa", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(6, ui_test_utils::FindInPage(tab, L"goa",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(3, ordinal);
|
| // Add space to search (should result in no matches).
|
| - EXPECT_EQ(0, FindInPage(L"goa ", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(tab, L"goa ",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
| // Remove the space, should be back to '3 out of 6')
|
| - EXPECT_EQ(6, FindInPage(L"goa", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(6, ui_test_utils::FindInPage(tab, L"goa",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(3, ordinal);
|
| }
|
|
|
| @@ -335,9 +316,12 @@
|
| ui_test_utils::NavigateToURL(browser(), url);
|
|
|
| int ordinal = 0;
|
| - EXPECT_EQ(0, FindInPage(L"text", FWD, IGNORE_CASE, &ordinal));
|
| + TabContents* tab = browser()->GetSelectedTabContents();
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(tab, L"text",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(-1, ordinal); // Nothing is selected.
|
| - EXPECT_EQ(0, FindInPage(L"Non-existing string", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(tab, L"Non-existing string",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
| }
|
|
|
| @@ -359,13 +343,16 @@
|
| // TODO(jungshik): According to a native Malayalam speaker, it's ok not
|
| // to find U+0D4C. Still need to investigate further this issue.
|
| int ordinal = 0;
|
| - FindInPage(L"\u0D4C", FWD, IGNORE_CASE, &ordinal);
|
| - FindInPage(L"\u0D4C", FWD, IGNORE_CASE, &ordinal);
|
| + TabContents* tab = browser()->GetSelectedTabContents();
|
| + ui_test_utils::FindInPage(tab, L"\u0D4C", kFwd, kIgnoreCase, &ordinal);
|
| + ui_test_utils::FindInPage(tab, L"\u0D4C", kFwd, kIgnoreCase, &ordinal);
|
|
|
| // This should work fine.
|
| - EXPECT_EQ(1, FindInPage(L"\u0D24\u0D46", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab, L"\u0D24\u0D46",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| - EXPECT_EQ(0, FindInPage(L"nostring", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(tab, L"nostring",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
| }
|
|
|
| @@ -380,7 +367,8 @@
|
|
|
| // This used to crash the tab.
|
| int ordinal = 0;
|
| - EXPECT_EQ(0, FindInPage(L"s", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(browser()->GetSelectedTabContents(),
|
| + L"s", kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
| }
|
|
|
| @@ -402,7 +390,9 @@
|
| // 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.
|
| int ordinal = 0;
|
| - EXPECT_EQ(5, FindInPage(L"008.xml", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(5, ui_test_utils::FindInPage(browser()->GetSelectedTabContents(),
|
| + L"008.xml",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| }
|
|
|
| @@ -421,7 +411,8 @@
|
|
|
| // Search for a text that exists within a link on the page.
|
| int ordinal = 0;
|
| - EXPECT_EQ(2, FindInPage(L"html ", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(2, ui_test_utils::FindInPage(tab_contents, L"html ",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
| }
|
|
|
| @@ -526,7 +517,9 @@
|
|
|
| // Search for 'dream' which the Find box is obscuring.
|
| int ordinal = 0;
|
| - EXPECT_EQ(1, FindInPage(L"dream", FWD, IGNORE_CASE, &ordinal));
|
| + TabContents* tab = browser()->GetSelectedTabContents();
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab, L"dream",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
|
|
| // Make sure Find box has moved.
|
| @@ -536,7 +529,8 @@
|
| EXPECT_TRUE(fully_visible);
|
|
|
| // Search for 'Too much' which the Find box is not obscuring.
|
| - EXPECT_EQ(1, FindInPage(L"Too much", FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(1, ui_test_utils::FindInPage(tab, L"Too much",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(1, ordinal);
|
|
|
| // Make sure Find box has moved back to its original location.
|
| @@ -556,7 +550,9 @@
|
|
|
| // Search for 'no_match'. No matches should be found.
|
| int ordinal = 0;
|
| - EXPECT_EQ(0, FindInPage(L"no_match", FWD, IGNORE_CASE, &ordinal));
|
| + TabContents* tab = browser()->GetSelectedTabContents();
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(tab, L"no_match",
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
|
|
| // Open another tab (tab B).
|
| @@ -565,7 +561,8 @@
|
|
|
| // Simulate what happens when you press F3 for FindNext. We should get a
|
| // response here (a hang means search was aborted).
|
| - EXPECT_EQ(0, FindInPage(std::wstring(), FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(tab, std::wstring(),
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
|
|
| // Open another tab (tab C).
|
| @@ -574,7 +571,8 @@
|
|
|
| // Simulate what happens when you press F3 for FindNext. We should get a
|
| // response here (a hang means search was aborted).
|
| - EXPECT_EQ(0, FindInPage(std::wstring(), FWD, IGNORE_CASE, &ordinal));
|
| + EXPECT_EQ(0, ui_test_utils::FindInPage(tab, std::wstring(),
|
| + kFwd, kIgnoreCase, &ordinal));
|
| EXPECT_EQ(0, ordinal);
|
| }
|
|
|
|
|