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

Side by Side Diff: content/shell/tools/plugin/Tests/FormValue.cpp

Issue 1852523003: Remove NPAPI test plugin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_last_plugin_layout_tests
Patch Set: fix isolate Created 4 years, 8 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
OLDNEW
(Empty)
1 // Copyright 2014 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 "PluginTest.h"
6 #include <string.h>
7
8 extern NPNetscapeFuncs *browser;
9
10 class FormValue : public PluginTest {
11 public:
12 FormValue(NPP npp, const std::string& identifier)
13 : PluginTest(npp, identifier)
14 {
15 }
16 NPError NPP_GetValue(NPPVariable, void*) override;
17 };
18
19 NPError FormValue::NPP_GetValue(NPPVariable variable, void *value)
20 {
21 if (variable == NPPVformValue) {
22 static const char formValueText[] = "Plugin form value";
23 *((void**)value) = browser->memalloc(sizeof(formValueText));
24 if (!*((void**)value))
25 return NPERR_OUT_OF_MEMORY_ERROR;
26 strncpy(*((char**)value), formValueText, sizeof(formValueText));
27 return NPERR_NO_ERROR;
28 }
29 return NPERR_GENERIC_ERROR;
30 }
31
32 static PluginTest::Register<FormValue> formValue("form-value");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698