summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-01 15:19:40 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-01 15:19:40 +0000
commit3b94427c99bdf12836fd455eeb1499fdde511e26 (patch)
tree07d81236cb8b177a565d10a808a5601ef6c0ff5b /chrome/browser/ui/views/find_bar_host_interactive_uitest.cc
parentb2fcd0e0c8850eda2135b6fe270af5f453682f23 (diff)
downloadchromium_src-3b94427c99bdf12836fd455eeb1499fdde511e26.zip
chromium_src-3b94427c99bdf12836fd455eeb1499fdde511e26.tar.gz
chromium_src-3b94427c99bdf12836fd455eeb1499fdde511e26.tar.bz2
Revert 67849 - Figure out error in test PrepopulateRespectBlank.
Revert previous traces and add one targeted test. My traces seem to indicate that something else than a Chrome window has focus when the test fails. Lets figure out what that is... BUG=62937 TEST=Tracking down problem in test Review URL: http://codereview.chromium.org/5463001 TBR=finnur@chromium.org Review URL: http://codereview.chromium.org/5451002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/find_bar_host_interactive_uitest.cc')
-rw-r--r--chrome/browser/ui/views/find_bar_host_interactive_uitest.cc50
1 files changed, 1 insertions, 49 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 9195df5..2049eb0 100644
--- a/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc
+++ b/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc
@@ -3,8 +3,6 @@
// found in the LICENSE file.
#include "app/keyboard_codes.h"
-#include "base/process_util.h"
-#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/find_bar_controller.h"
@@ -20,11 +18,6 @@
#include "views/focus/focus_manager.h"
#include "views/view.h"
-#if defined(OS_WIN)
-#include <windows.h>
-#include <Psapi.h>
-#endif
-
namespace {
// The delay waited after sending an OS simulated event.
@@ -51,44 +44,6 @@ void Checkpoint(const char* message, const base::TimeTicks& start_time) {
<< " ms" << std::flush;
}
-// Test to make sure Chrome is in the foreground as we start testing. This is
-// required for tests that synthesize input to the Chrome window.
-bool ChromeInForeground() {
-#if defined(OS_WIN)
- HWND window = ::GetForegroundWindow();
- std::wstring caption;
- std::wstring filename;
- int len = ::GetWindowTextLength(window) + 1;
- ::GetWindowText(window, WriteInto(&caption, len), len);
- bool chrome_window_in_foreground =
- (caption == L"about:blank - Google Chrome");
- if (!chrome_window_in_foreground) {
- DWORD process_id;
- int thread_id = ::GetWindowThreadProcessId(window, &process_id);
-
- base::ProcessHandle process;
- if (base::OpenProcessHandleWithAccess(process_id,
- PROCESS_QUERY_LIMITED_INFORMATION,
- &process)) {
- len = MAX_PATH;
- if (!GetProcessImageFileName(process, WriteInto(&filename, len), len)) {
- int error = GetLastError();
- filename = L"Unable to read filename (error " +
- base::IntToString16(error) + L")";
- }
- base::CloseProcessHandle(process);
- }
- }
- EXPECT_TRUE(chrome_window_in_foreground)
- << "Chrome must be in the foreground when running interactive tests\n"
- << "Process in foreground: " << filename.c_str();
- return chrome_window_in_foreground;
-#else
- // Windows only at the moment.
- return true;
-#endif
-}
-
} // namespace
IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) {
@@ -178,15 +133,12 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, PrepopulateRespectBlank) {
// FindInPage on Mac doesn't use prepopulated values. Search there is global.
return;
#endif
+
base::TimeTicks start_time = base::TimeTicks::Now();
Checkpoint("Starting test server", 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(ChromeInForeground());
-
// First we navigate to any page.
Checkpoint("Navigating", start_time);
GURL url = test_server()->GetURL(kSimplePage);