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

Unified Diff: webkit/glue/plugins/test/plugin_window_size_test.cc

Issue 42626: Report the plugin position to windowed plugins as (0,0)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months 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/plugin/webplugin_proxy.cc ('k') | webkit/glue/plugins/webplugin_delegate_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/test/plugin_window_size_test.cc
===================================================================
--- webkit/glue/plugins/test/plugin_window_size_test.cc (revision 12476)
+++ webkit/glue/plugins/test/plugin_window_size_test.cc (working copy)
@@ -13,8 +13,8 @@
}
NPError PluginWindowSizeTest::SetWindow(NPWindow* pNPWindow) {
- if (!pNPWindow ||
- !::IsWindow(reinterpret_cast<HWND>(pNPWindow->window))) {
+ HWND window = reinterpret_cast<HWND>(pNPWindow->window);
+ if (!pNPWindow || !::IsWindow(window)) {
SetError("Invalid arguments passed in");
return NPERR_INVALID_PARAM;
}
@@ -27,12 +27,22 @@
if (!::IsRectEmpty(&window_rect)) {
RECT client_rect = {0};
- ::GetClientRect(reinterpret_cast<HWND>(pNPWindow->window),
- &client_rect);
+ ::GetClientRect(window, &client_rect);
if (::IsRectEmpty(&client_rect)) {
SetError("The client rect of the plugin window is empty. Test failed");
}
+ // Bug 6742: ensure that the coordinates passed in are relative to the
+ // parent HWND.
+ POINT origin_from_os;
+ RECT window_rect_from_os;
+ ::GetWindowRect(window, &window_rect_from_os);
+ origin_from_os.x = window_rect_from_os.left;
+ origin_from_os.y = window_rect_from_os.top;
+ ::ScreenToClient(GetParent(window), &origin_from_os);
+ if (origin_from_os.x != pNPWindow->x || origin_from_os.y != pNPWindow->y)
+ SetError("Wrong position passed in to SetWindow! Test failed");
+
SignalTestCompleted();
}
« no previous file with comments | « chrome/plugin/webplugin_proxy.cc ('k') | webkit/glue/plugins/webplugin_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698