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

Side by Side Diff: webkit/glue/plugins/test/plugin_get_javascript_url_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_get_javascript_url_test.h" 5 #include "webkit/glue/plugins/test/plugin_get_javascript_url_test.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 8
9 // url for "self". 9 // url for "self".
10 #define SELF_URL "javascript:window.location+\"\"" 10 #define SELF_URL "javascript:window.location+\"\""
(...skipping 15 matching lines...) Expand all
26 ExecuteGetJavascriptUrlTest::ExecuteGetJavascriptUrlTest(NPP id, NPNetscapeFuncs *host_functions) 26 ExecuteGetJavascriptUrlTest::ExecuteGetJavascriptUrlTest(NPP id, NPNetscapeFuncs *host_functions)
27 : PluginTest(id, host_functions), 27 : PluginTest(id, host_functions),
28 test_started_(false), 28 test_started_(false),
29 #ifdef OS_WIN 29 #ifdef OS_WIN
30 window_(NULL), 30 window_(NULL),
31 #endif 31 #endif
32 npn_evaluate_context_(false) { 32 npn_evaluate_context_(false) {
33 } 33 }
34 34
35 NPError ExecuteGetJavascriptUrlTest::SetWindow(NPWindow* pNPWindow) { 35 NPError ExecuteGetJavascriptUrlTest::SetWindow(NPWindow* pNPWindow) {
36 if (pNPWindow->window == NULL)
37 return NPERR_NO_ERROR;
38
36 if (!test_started_) { 39 if (!test_started_) {
37 std::string url = SELF_URL; 40 std::string url = SELF_URL;
38 HostFunctions()->geturlnotify(id(), url.c_str(), "_top", 41 HostFunctions()->geturlnotify(id(), url.c_str(), "_top",
39 reinterpret_cast<void*>(SELF_URL_STREAM_ID)); 42 reinterpret_cast<void*>(SELF_URL_STREAM_ID));
40 test_started_ = true; 43 test_started_ = true;
41 44
42 #ifdef OS_WIN 45 #ifdef OS_WIN
43 HWND window_handle = reinterpret_cast<HWND>(pNPWindow->window); 46 HWND window_handle = reinterpret_cast<HWND>(pNPWindow->window);
44 if (!::GetProp(window_handle, L"Plugin_Instance")) { 47 if (!::GetProp(window_handle, L"Plugin_Instance")) {
45 ::SetProp(window_handle, L"Plugin_Instance", this); 48 ::SetProp(window_handle, L"Plugin_Instance", this);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 SetError("Failed to obtain window location."); 201 SetError("Failed to obtain window location.");
199 SignalTestCompleted(); 202 SignalTestCompleted();
200 break; 203 break;
201 default: 204 default:
202 SetError("Unexpected NewStream callback"); 205 SetError("Unexpected NewStream callback");
203 break; 206 break;
204 } 207 }
205 } 208 }
206 209
207 } // namespace NPAPIClient 210 } // namespace NPAPIClient
OLDNEW
« no previous file with comments | « webkit/glue/plugins/test/plugin_get_javascript_url2_test.cc ('k') | webkit/glue/plugins/test/plugin_geturl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698