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

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

Issue 6012002: Move the NPAPI files from webkit/glue/plugins to webkit/plugins/npapi and put... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h"
6
7 #include "webkit/glue/plugins/test/plugin_client.h"
8
9 namespace NPAPIClient {
10
11 #define kUrl "javascript:window.location+\"\""
12 #define kUrlStreamId 1
13
14 DeletePluginInStreamTest::DeletePluginInStreamTest(NPP id, NPNetscapeFuncs *host _functions)
15 : PluginTest(id, host_functions),
16 test_started_(false) {
17 }
18
19 NPError DeletePluginInStreamTest::SetWindow(NPWindow* pNPWindow) {
20 if (pNPWindow->window == NULL)
21 return NPERR_NO_ERROR;
22
23 if (!test_started_) {
24 std::string url = "self_delete_plugin_stream.html";
25 HostFunctions()->geturlnotify(id(), url.c_str(), NULL,
26 reinterpret_cast<void*>(kUrlStreamId));
27 test_started_ = true;
28 }
29 return NPERR_NO_ERROR;
30 }
31
32 NPError DeletePluginInStreamTest::NewStream(NPMIMEType type, NPStream* stream,
33 NPBool seekable, uint16* stype) {
34 NPIdentifier delete_id = HostFunctions()->getstringidentifier("DeletePluginWit hinScript");
35
36 NPObject *window_obj = NULL;
37 HostFunctions()->getvalue(id(), NPNVWindowNPObject, &window_obj);
38
39 NPVariant rv;
40 HostFunctions()->invoke(id(), window_obj, delete_id, NULL, 0, &rv);
41
42 return NPERR_NO_ERROR;
43 }
44
45 } // namespace NPAPIClient
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698