diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-28 16:31:57 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-28 16:31:57 +0000 |
commit | 20e93d1f20dc0e3c626a2500c96f85e89cf184c9 (patch) | |
tree | 80307da7589ce802e88ca79c6b60493496770e80 /chrome/test/ui/ui_test.cc | |
parent | 50664fdc92a8d1db14d83c902f67b7a8dce76480 (diff) | |
download | chromium_src-20e93d1f20dc0e3c626a2500c96f85e89cf184c9.zip chromium_src-20e93d1f20dc0e3c626a2500c96f85e89cf184c9.tar.gz chromium_src-20e93d1f20dc0e3c626a2500c96f85e89cf184c9.tar.bz2 |
Adding a test to catch regressions where the Find box moves when you open and close a tab. Test is disabled until we fix the bug.
Also made the error message for when tests fails because crash_service isn't running a bit explicit (unrelated to the rest of this change).
BUG=1343052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1488 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui/ui_test.cc')
-rw-r--r-- | chrome/test/ui/ui_test.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 22678ff..d2d619f 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -114,7 +114,9 @@ void UITest::TearDown() { std::wstring error_msg = L"Encountered an unexpected crash in the program during this test."; if (expected_crashes_ > 0 && actual_crashes == 0) - error_msg += L" Have you started crash_service.exe?"; + error_msg += L" NOTE: This test is expected to fail if crash_service.exe " + L"is not running. Start it manually before running this " + L"test (see the build output directory)."; EXPECT_EQ(expected_crashes_, actual_crashes) << error_msg; } @@ -359,6 +361,21 @@ bool UITest::WaitForDownloadShelfVisible(TabProxy* tab) { return false; } +bool UITest::WaitForFindWindowFullyVisible(TabProxy* tab) { + const int kCycles = 20; + for (int i = 0; i < kCycles; i++) { + bool visible = false; + if (!tab->IsFindWindowFullyVisible(&visible)) + return false; // Some error. + if (visible) + return true; // Find window is visible. + + // Give it a chance to catch up. + Sleep(kWaitForActionMaxMsec / kCycles); + } + return false; +} + GURL UITest::GetActiveTabURL() { scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); if (!tab_proxy.get()) @@ -416,7 +433,7 @@ DictionaryValue* UITest::GetLocalState() { } DictionaryValue* UITest::GetDefaultProfilePreferences() { - std::wstring path; + std::wstring path; PathService::Get(chrome::DIR_USER_DATA, &path); file_util::AppendToPath(&path, chrome::kNotSignedInProfile); file_util::AppendToPath(&path, chrome::kPreferencesFilename); |