summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-19 05:35:22 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-19 05:35:22 +0000
commitb95f550fa7ef1723adf93f0292667979be66fa08 (patch)
tree56a6398774c2a24bb65ea7d30d6c6542309fa019 /chrome_frame/test
parent552e600db9f51ac1efb0438bd749227226dffa64 (diff)
downloadchromium_src-b95f550fa7ef1723adf93f0292667979be66fa08.zip
chromium_src-b95f550fa7ef1723adf93f0292667979be66fa08.tar.gz
chromium_src-b95f550fa7ef1723adf93f0292667979be66fa08.tar.bz2
Ensure that the renderer has focus when ChromeFrame navigates to a URL in IE full tab mode.
This fixes bug http://code.google.com/p/chromium/issues/detail?id=22745 Test=Covered by unit test. Bug=22745 Review URL: http://codereview.chromium.org/402079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r--chrome_frame/test/chrome_frame_unittests.cc31
1 files changed, 30 insertions, 1 deletions
diff --git a/chrome_frame/test/chrome_frame_unittests.cc b/chrome_frame/test/chrome_frame_unittests.cc
index 875695e..c9d081a 100644
--- a/chrome_frame/test/chrome_frame_unittests.cc
+++ b/chrome_frame/test/chrome_frame_unittests.cc
@@ -101,7 +101,10 @@ void ChromeFrameTestWithWebServer::TearDown() {
bool ChromeFrameTestWithWebServer::LaunchBrowser(BrowserKind browser,
const wchar_t* page) {
- std::wstring url = UTF8ToWide(server_.Resolve(page).spec());
+ std::wstring url = page;
+ if (url.find(L"files/") != std::wstring::npos)
+ url = UTF8ToWide(server_.Resolve(page).spec());
+
browser_ = browser;
if (browser == IE) {
browser_handle_.Set(chrome_frame_test::LaunchIE(url));
@@ -1741,3 +1744,29 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_BackForward) {
chrome_frame_test::CloseAllIEWindows();
}
+const wchar_t kChromeFrameAboutBlankUrl[] = L"cf:about:blank";
+
+TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_ChromeFrameFocusTest) {
+ TimedMsgLoop loop;
+
+ ASSERT_TRUE(LaunchBrowser(IE, kChromeFrameAboutBlankUrl));
+
+ // Allow some time for chrome to be launched.
+ loop.RunFor(kChromeFrameLaunchDelay);
+
+ HWND renderer_window = chrome_frame_test::GetChromeRendererWindow();
+ EXPECT_TRUE(IsWindow(renderer_window));
+
+ DWORD renderer_thread_id = 0;
+ DWORD renderer_process_id = 0;
+ renderer_thread_id = GetWindowThreadProcessId(renderer_window,
+ &renderer_process_id);
+
+ AttachThreadInput(GetCurrentThreadId(), renderer_thread_id, TRUE);
+ HWND focus_window = GetFocus();
+ EXPECT_TRUE(focus_window == renderer_window);
+ AttachThreadInput(GetCurrentThreadId(), renderer_thread_id, FALSE);
+
+ chrome_frame_test::CloseAllIEWindows();
+}
+