diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-19 15:07:39 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-19 15:07:39 +0000 |
commit | 6f54b9b29087aad960be16e0c7060d73398ae001 (patch) | |
tree | 2d438c47a63cd077ff1dcde391b906260a4b7f64 | |
parent | 7a49f7e11538758a8b9f7af60c563dd42b45a48d (diff) | |
download | chromium_src-6f54b9b29087aad960be16e0c7060d73398ae001.zip chromium_src-6f54b9b29087aad960be16e0c7060d73398ae001.tar.gz chromium_src-6f54b9b29087aad960be16e0c7060d73398ae001.tar.bz2 |
Re-enable a few find in page tests.
They had been disabled -- not due to inherent flakiness in the test itself, but due to an environment issue (bug 96594) which affects a good number of tests. I'm following the precedent of others by re-enabling these tests while we work on a solution for the underlying environment issue. Note: We've already had a regression due to the tests being disabled.
TBR=sky
BUG=145476, 128724, 152100, 177487
Review URL: https://chromiumcodereview.appspot.com/14295003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195201 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/views/find_bar_host_interactive_uitest.cc | 70 | ||||
-rw-r--r-- | chrome/browser/ui/views/find_bar_view.cc | 2 |
2 files changed, 9 insertions, 63 deletions
diff --git a/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc b/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc index b65a199..cc55a36 100644 --- a/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc +++ b/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc @@ -31,16 +31,8 @@ using content::WebContents; namespace { -// The delay waited after sending an OS simulated event. -static const int kActionDelayMs = 500; static const char kSimplePage[] = "files/find_in_page/simple.html"; -void Checkpoint(const char* message, const base::TimeTicks& start_time) { - LOG(INFO) << message << " : " - << (base::TimeTicks::Now() - start_time).InMilliseconds() - << " ms" << std::flush; -} - class FindInPageTest : public InProcessBrowserTest { public: FindInPageTest() { @@ -65,13 +57,8 @@ class FindInPageTest : public InProcessBrowserTest { } // namespace -// Fails often on Win, CrOS. http://crbug.com/145476, http://crbug.com/128724 -#if defined(OS_WIN) || defined(OS_CHROMEOS) -#define MAYBE_CrashEscHandlers DISABLED_CrashEscHandlers -#else -#define MAYBE_CrashEscHandlers CrashEscHandlers -#endif -IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_CrashEscHandlers) { +// Flaky because the test server fails to start? See: http://crbug.com/96594. +IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) { ASSERT_TRUE(test_server()->Start()); // First we navigate to our test page (tab A). @@ -105,13 +92,8 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_CrashEscHandlers) { browser(), ui::VKEY_ESCAPE, false, false, false, false)); } -// Fails to start the test server on ChromeOS: http://crbug.com/168974 -#if defined(OS_CHROMEOS) -#define MAYBE_FocusRestore DISABLED_FocusRestore -#else -#define MAYBE_FocusRestore FocusRestore -#endif -IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_FocusRestore) { +// Flaky because the test server fails to start? See: http://crbug.com/96594. +IN_PROC_BROWSER_TEST_F(FindInPageTest, FocusRestore) { ASSERT_TRUE(test_server()->Start()); GURL url = test_server()->GetURL("title1.html"); @@ -158,13 +140,8 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_FocusRestore) { EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); } -// Fails often on Win, CrOS. http://crbug.com/145476, http://crbug.com/128724 -#if defined(OS_WIN) || defined(OS_CHROMEOS) -#define MAYBE_FocusRestoreOnTabSwitch DISABLED_FocusRestoreOnTabSwitch -#else -#define MAYBE_FocusRestoreOnTabSwitch FocusRestoreOnTabSwitch -#endif -IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_FocusRestoreOnTabSwitch) { +// Flaky because the test server fails to start? See: http://crbug.com/96594. +IN_PROC_BROWSER_TEST_F(FindInPageTest, FocusRestoreOnTabSwitch) { ASSERT_TRUE(test_server()->Start()); // First we navigate to our test page (tab A). @@ -217,43 +194,28 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_FocusRestoreOnTabSwitch) { EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); } -// Flaky on XP: http://crbug.com/152100 -// Flaky on ChromiumOS: http://crbug.com/177487 -#if defined(OS_WIN) || defined(OS_CHROMEOS) -#define MAYBE_PrepopulateRespectBlank DISABLED_PrepopulateRespectBlank -#else -#define MAYBE_PrepopulateRespectBlank PrepopulateRespectBlank -#endif +// Flaky because the test server fails to start? See: http://crbug.com/96594. // This tests that whenever you clear values from the Find box and close it that // it respects that and doesn't show you the last search, as reported in bug: // http://crbug.com/40121. -IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_PrepopulateRespectBlank) { +IN_PROC_BROWSER_TEST_F(FindInPageTest, PrepopulateRespectBlank) { #if defined(OS_MACOSX) // FindInPage on Mac doesn't use prepopulated values. Search there is global. return; #endif - base::TimeTicks start_time = base::TimeTicks::Now(); - Checkpoint("Test starting", start_time); - ASSERT_TRUE(test_server()->Start()); // Make sure Chrome is in the foreground, otherwise sending input // won't do anything and the test will hang. ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); - Checkpoint("Navigate", start_time); - // First we navigate to any page. GURL url = test_server()->GetURL(kSimplePage); ui_test_utils::NavigateToURL(browser(), url); - Checkpoint("Show Find bar", start_time); - // Show the Find bar. browser()->GetFindBarController()->Show(); - Checkpoint("Search for 'a'", start_time); - // Search for "a". ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), ui::VKEY_A, false, false, false, false)); @@ -261,8 +223,6 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_PrepopulateRespectBlank) { // We should find "a" here. EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarText()); - Checkpoint("Delete 'a'", start_time); - // Delete "a". ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), ui::VKEY_BACK, false, false, false, false)); @@ -270,42 +230,28 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, MAYBE_PrepopulateRespectBlank) { // Validate we have cleared the text. EXPECT_EQ(string16(), GetFindBarText()); - Checkpoint("Close find bar", start_time); - // Close the Find box. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), ui::VKEY_ESCAPE, false, false, false, false)); - Checkpoint("Show Find bar", start_time); - // Show the Find bar. browser()->GetFindBarController()->Show(); - Checkpoint("Validate text", start_time); - // After the Find box has been reopened, it should not have been prepopulated // with "a" again. EXPECT_EQ(string16(), GetFindBarText()); - Checkpoint("Close Find bar", start_time); - // Close the Find box. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), ui::VKEY_ESCAPE, false, false, false, false)); - Checkpoint("FindNext", start_time); - // Press F3 to trigger FindNext. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), ui::VKEY_F3, false, false, false, false)); - Checkpoint("Validate", start_time); - // After the Find box has been reopened, it should still have no prepopulate // value. EXPECT_EQ(string16(), GetFindBarText()); - - Checkpoint("Test done", start_time); } // Flaky on Win. http://crbug.com/92467 diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc index 930a534..096a048 100644 --- a/chrome/browser/ui/views/find_bar_view.cc +++ b/chrome/browser/ui/views/find_bar_view.cc @@ -192,7 +192,7 @@ void FindBarView::UpdateForResult(const FindNotificationDetails& result, // composed by them. To avoid this problem, we should check the IME status and // update the text only when the IME is not composing text. if (find_text_->text() != find_text && !find_text_->IsIMEComposing()) { - find_text_->SetText(find_text); + SetFindText(find_text); find_text_->SelectAll(true); } |