Skip to content
Permalink
Browse files
Teach WindowGeometryInitializedBeforeSetWindow that NPP_SetWindow can…
… be called more than once

The NPP_SetWindow call made when the plugin is torn down was confusing
us, and was causing us to spew an error into the next test.

Fixes <http://webkit.org/b/46900> <rdar://problem/8496888> REGRESSION
(r68520): plugins/access-after-page-destroyed.html failing on Windows

Reviewed by Anders Carlsson.

* DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp:
(WindowGeometryInitializedBeforeSetWindow::WindowGeometryInitializedBeforeSetWindow):
Initialize member.
(WindowGeometryInitializedBeforeSetWindow::NPP_SetWindow): Bail if
this isn't the first time this is called.

Canonical link: https://commits.webkit.org/59417@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@68785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aroben committed Sep 30, 2010
1 parent 88f7621 commit 8ebfb3a9f8c2acd62ca68b8453bb6513073c5156
Showing 2 changed files with 27 additions and 1 deletion.
@@ -1,3 +1,22 @@
2010-09-30 Adam Roben <aroben@apple.com>

Teach WindowGeometryInitializedBeforeSetWindow that NPP_SetWindow can
be called more than once

The NPP_SetWindow call made when the plugin is torn down was confusing
us, and was causing us to spew an error into the next test.

Fixes <http://webkit.org/b/46900> <rdar://problem/8496888> REGRESSION
(r68520): plugins/access-after-page-destroyed.html failing on Windows

Reviewed by Anders Carlsson.

* DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp:
(WindowGeometryInitializedBeforeSetWindow::WindowGeometryInitializedBeforeSetWindow):
Initialize member.
(WindowGeometryInitializedBeforeSetWindow::NPP_SetWindow): Bail if
this isn't the first time this is called.

2010-09-30 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.
@@ -35,12 +35,17 @@ class WindowGeometryInitializedBeforeSetWindow : public PluginTest {
public:
WindowGeometryInitializedBeforeSetWindow(NPP npp, const string& identifier)
: PluginTest(npp, identifier)
, m_didReceiveInitialSetWindowCall(false)
{
}

private:
virtual NPError NPP_SetWindow(NPP instance, NPWindow* window)
{
if (m_didReceiveInitialSetWindowCall)
return NPERR_NO_ERROR;
m_didReceiveInitialSetWindowCall = true;

if (window->type != NPWindowTypeWindow) {
pluginLog(instance, "window->type should be NPWindowTypeWindow but was %d", window->type);
return NPERR_GENERIC_ERROR;
@@ -77,7 +82,9 @@ class WindowGeometryInitializedBeforeSetWindow : public PluginTest {

pluginLog(instance, "Plugin's HWND has been sized and positioned before NPP_SetWindow was called");
return NPERR_NO_ERROR;
}
}

bool m_didReceiveInitialSetWindowCall;
};

static PluginTest::Register<WindowGeometryInitializedBeforeSetWindow> windowGeometryInitializedBeforeSetWindow("window-geometry-initialized-before-set-window");

0 comments on commit 8ebfb3a

Please sign in to comment.