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

Side by Side Diff: webkit/glue/plugins/test/plugin_window_size_test.cc

Issue 1073003: Added a test for pepper3d. It ensures that we can successfully load a pepper ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/glue/plugins/test/plugin_window_size_test.h" 5 #include "webkit/glue/plugins/test/plugin_window_size_test.h"
6 #include "webkit/glue/plugins/test/plugin_client.h" 6 #include "webkit/glue/plugins/test/plugin_client.h"
7 7
8 namespace NPAPIClient { 8 namespace NPAPIClient {
9 9
10 PluginWindowSizeTest::PluginWindowSizeTest(NPP id, 10 PluginWindowSizeTest::PluginWindowSizeTest(NPP id,
11 NPNetscapeFuncs *host_functions) 11 NPNetscapeFuncs *host_functions)
12 : PluginTest(id, host_functions) { 12 : PluginTest(id, host_functions) {
13 } 13 }
14 14
15 NPError PluginWindowSizeTest::SetWindow(NPWindow* pNPWindow) { 15 NPError PluginWindowSizeTest::SetWindow(NPWindow* pNPWindow) {
16 if (pNPWindow->window == NULL)
17 return NPERR_NO_ERROR;
18
16 HWND window = reinterpret_cast<HWND>(pNPWindow->window); 19 HWND window = reinterpret_cast<HWND>(pNPWindow->window);
17 if (!pNPWindow || !::IsWindow(window)) { 20 if (!pNPWindow || !::IsWindow(window)) {
18 SetError("Invalid arguments passed in"); 21 SetError("Invalid arguments passed in");
19 return NPERR_INVALID_PARAM; 22 return NPERR_INVALID_PARAM;
20 } 23 }
21 24
22 RECT window_rect = {0}; 25 RECT window_rect = {0};
23 window_rect.left = pNPWindow->x; 26 window_rect.left = pNPWindow->x;
24 window_rect.top = pNPWindow->y; 27 window_rect.top = pNPWindow->y;
25 window_rect.right = pNPWindow->width; 28 window_rect.right = pNPWindow->width;
(...skipping 17 matching lines...) Expand all
43 if (origin_from_os.x != pNPWindow->x || origin_from_os.y != pNPWindow->y) 46 if (origin_from_os.x != pNPWindow->x || origin_from_os.y != pNPWindow->y)
44 SetError("Wrong position passed in to SetWindow! Test failed"); 47 SetError("Wrong position passed in to SetWindow! Test failed");
45 48
46 SignalTestCompleted(); 49 SignalTestCompleted();
47 } 50 }
48 51
49 return NPERR_NO_ERROR; 52 return NPERR_NO_ERROR;
50 } 53 }
51 54
52 } // namespace NPAPIClient 55 } // namespace NPAPIClient
OLDNEW
« no previous file with comments | « webkit/glue/plugins/test/plugin_test_factory.cc ('k') | webkit/glue/plugins/test/plugin_windowed_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698