diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-30 01:34:21 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-30 01:34:21 +0000 |
commit | bb3bb6d013ca8b7b9fde9b985950f181cc32577a (patch) | |
tree | 30ba9b45108c020dd87754a8ee8b7f29e8c883c4 /chrome_frame/test | |
parent | cd613a9e4ec193ebc5163e4b8e660be729077f94 (diff) | |
download | chromium_src-bb3bb6d013ca8b7b9fde9b985950f181cc32577a.zip chromium_src-bb3bb6d013ca8b7b9fde9b985950f181cc32577a.tar.gz chromium_src-bb3bb6d013ca8b7b9fde9b985950f181cc32577a.tar.bz2 |
The newly added AboutChromeFrame test for IE full tab mode was failing on the chrome frame builder which is
an XP machine with IE8 (It was not supposed to return on IE8 :) The reason being that the VK_UP keyboard
message we were passing in via SendInput needs the extended flag to be true. I added the extended flag
as an argument to the SendVirtualKey helper function.
On a related note, I removed the GetIEVersion check from the utility function which launches IE as a COM
server as the IE version checking function checks the version of the current module and compares it against
IE versions which is hilarious. In any case these tests work fine.
TBR=amit
Review URL: http://codereview.chromium.org/339076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30549 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r-- | chrome_frame/test/chrome_frame_test_utils.cc | 11 | ||||
-rw-r--r-- | chrome_frame/test/chrome_frame_test_utils.h | 3 | ||||
-rw-r--r-- | chrome_frame/test/chrome_frame_unittests.cc | 6 | ||||
-rw-r--r-- | chrome_frame/test/net/dialog_watchdog.cc | 4 |
4 files changed, 10 insertions, 14 deletions
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc index bd33db6..e9786fc 100644 --- a/chrome_frame/test/chrome_frame_test_utils.cc +++ b/chrome_frame/test/chrome_frame_test_utils.cc @@ -212,16 +212,17 @@ bool SendString(const wchar_t* string) { return true; } -void SendVirtualKey(int16 key) { +void SendVirtualKey(int16 key, bool extended) { INPUT input = { INPUT_KEYBOARD }; input.ki.wVk = key; + input.ki.dwFlags = extended ? KEYEVENTF_EXTENDEDKEY : 0; SendInput(1, &input, sizeof(input)); - input.ki.dwFlags = KEYEVENTF_KEYUP; + input.ki.dwFlags = (extended ? KEYEVENTF_EXTENDEDKEY : 0) | KEYEVENTF_KEYUP; SendInput(1, &input, sizeof(input)); } void SendChar(char c) { - SendVirtualKey(VkKeyScanA(c)); + SendVirtualKey(VkKeyScanA(c), false); } void SendString(const char* s) { @@ -441,8 +442,8 @@ void ShowChromeFrameContextMenu() { void SelectAboutChromeFrame() { // Send a key up message to enable the About chrome frame option to be // selected followed by a return to select it. - chrome_frame_test::SendVirtualKey(VK_UP); - chrome_frame_test::SendVirtualKey(VK_RETURN); + SendVirtualKey(VK_UP, true); + SendVirtualKey(VK_RETURN, false); } BOOL CALLBACK FindChromeRendererWindowProc( diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h index a9e1b3a..900f532 100644 --- a/chrome_frame/test/chrome_frame_test_utils.h +++ b/chrome_frame/test/chrome_frame_test_utils.h @@ -23,7 +23,8 @@ bool SendString(const wchar_t* s); // Sends a virtual key such as VK_TAB, VK_RETURN or a character that has been // translated to a virtual key. -void SendVirtualKey(int16 key); +// The extended flag indicates if this is an extended key +void SendVirtualKey(int16 key, bool extended); // Translates a single char to a virtual key and calls SendVirtualKey. void SendChar(char c); diff --git a/chrome_frame/test/chrome_frame_unittests.cc b/chrome_frame/test/chrome_frame_unittests.cc index 1d6dfe3..48d9993 100644 --- a/chrome_frame/test/chrome_frame_unittests.cc +++ b/chrome_frame/test/chrome_frame_unittests.cc @@ -1310,12 +1310,6 @@ HRESULT WebBrowserEventSink::LaunchIEAndNavigate( return S_FALSE; } - IEVersion ie_version = GetIEVersion(); - if (ie_version == IE_8) { - DLOG(INFO) << __FUNCTION__ << " Not running test on IE8"; - return S_FALSE; - } - EXPECT_TRUE(S_OK == LaunchIEAsComServer(web_browser2_.Receive())); web_browser2_->put_Visible(VARIANT_TRUE); diff --git a/chrome_frame/test/net/dialog_watchdog.cc b/chrome_frame/test/net/dialog_watchdog.cc index 27a01a0..8fd753a 100644 --- a/chrome_frame/test/net/dialog_watchdog.cc +++ b/chrome_frame/test/net/dialog_watchdog.cc @@ -59,12 +59,12 @@ bool SupplyProxyCredentials::OnDialogDetected(HWND hwnd, chrome_frame_test::SendString(username_.c_str()); Sleep(100); - chrome_frame_test::SendVirtualKey(VK_TAB); + chrome_frame_test::SendVirtualKey(VK_TAB, false); Sleep(100); chrome_frame_test::SendString(password_.c_str()); Sleep(100); - chrome_frame_test::SendVirtualKey(VK_RETURN); + chrome_frame_test::SendVirtualKey(VK_RETURN, false); return true; } |