Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: chrome_frame/test/chrome_frame_unittests.cc

Issue 402079: Ensure that the renderer has focus when ChromeFrame navigates to a URL in IE ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/chrome_frame_plugin.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/chrome_frame_unittests.cc
===================================================================
--- chrome_frame/test/chrome_frame_unittests.cc (revision 32473)
+++ chrome_frame/test/chrome_frame_unittests.cc (working copy)
@@ -101,7 +101,10 @@
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 @@
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();
+}
+
« no previous file with comments | « chrome_frame/chrome_frame_plugin.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698