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

Unified Diff: content/test/plugin/plugin_windowed_test.cc

Issue 150073002: Fix windowed plugins not appearing if opened in the background until the browser resizes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 11 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 | « content/test/plugin/plugin_test_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/plugin/plugin_windowed_test.cc
===================================================================
--- content/test/plugin/plugin_windowed_test.cc (revision 247553)
+++ content/test/plugin/plugin_windowed_test.cc (working copy)
@@ -39,7 +39,8 @@
if ((test_name() == "create_instance_in_paint" && test_id() == "1") ||
test_name() == "alert_in_window_message" ||
- test_name() == "set_title_in_paint") {
+ test_name() == "set_title_in_paint" ||
+ test_name() == "set_title_in_set_window_and_paint") {
static ATOM window_class = 0;
if (!window_class) {
WNDCLASSEX wcex;
@@ -68,6 +69,9 @@
::SetProp(window_, L"Plugin_Instance", this);
}
+ if (test_name() == "set_title_in_set_window_and_paint")
+ CallJSFunction(this, "PluginCreated");
+
return NPERR_NO_ERROR;
}
@@ -122,6 +126,18 @@
reinterpret_cast<WindowedPluginTest*>
(::GetProp(window, L"Plugin_Instance"));
+ if (message == WM_PAINT) {
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(window, &ps);
+ HBRUSH brush = CreateSolidBrush(RGB(255, 0, 0));
+ SelectObject(hdc, brush);
+ RECT r;
+ GetClientRect(window, &r);
+ Rectangle(hdc, 0, 0, r.right, r.bottom);
+ DeleteObject(brush);
+ EndPaint(window, &ps);
+ }
+
if (this_ptr && !this_ptr->done_) {
if (this_ptr->test_name() == "create_instance_in_paint" &&
message == WM_PAINT) {
@@ -138,6 +154,10 @@
message == WM_PAINT) {
this_ptr->done_ = true;
CallJSFunction(this_ptr, "SetTitle");
+ } else if (this_ptr->test_name() == "set_title_in_set_window_and_paint" &&
+ message == WM_PAINT) {
+ this_ptr->done_ = true;
+ CallJSFunction(this_ptr, "PluginShown");
}
if (this_ptr->done_) {
« no previous file with comments | « content/test/plugin/plugin_test_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698