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

Unified Diff: content/test/plugin/plugin_execute_stream_javascript.cc

Issue 1182303010: Delete the NPAPI plugin browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/test/plugin/plugin_execute_stream_javascript.cc
diff --git a/content/test/plugin/plugin_execute_stream_javascript.cc b/content/test/plugin/plugin_execute_stream_javascript.cc
deleted file mode 100644
index 33f6eec8ea97e97a4727b0f6e7ff799f47178c2c..0000000000000000000000000000000000000000
--- a/content/test/plugin/plugin_execute_stream_javascript.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/test/plugin/plugin_execute_stream_javascript.h"
-
-#include "base/basictypes.h"
-#include "content/test/plugin/plugin_client.h"
-
-namespace NPAPIClient {
-
-static const int kMaxLength = 4096;
-
-ExecuteStreamJavaScript::ExecuteStreamJavaScript(
- NPP id, NPNetscapeFuncs *host_functions)
- : PluginTest(id, host_functions) {
-}
-
-NPError ExecuteStreamJavaScript::NewStream(NPMIMEType type, NPStream* stream,
- NPBool seekable, uint16* stype) {
- return NPERR_NO_ERROR;
-}
-
-int32 ExecuteStreamJavaScript::WriteReady(NPStream *stream) {
- return kMaxLength;
-}
-
-int32 ExecuteStreamJavaScript::Write(NPStream *stream, int32 offset, int32 len,
- void *buffer) {
- if (stream == NULL) {
- SetError("Write got null stream");
- return -1;
- }
- if (len < 0 || len > kMaxLength) {
- SetError("Write got bogus stream chunk size");
- return -1;
- }
-
- std::string javascript("javascript:");
- javascript.append(static_cast<char*>(buffer), len);
- size_t js_length = javascript.length();
- if (js_length != static_cast<uint32_t>(js_length)) {
- SetError("Javascript too long.");
- return -1;
- }
-
- NPString script_string = { javascript.c_str(),
- static_cast<uint32_t>(js_length) };
- NPObject *window_obj = NULL;
- NPAPIClient::PluginClient::HostFunctions()->getvalue(
- id(), NPNVWindowNPObject, &window_obj);
-
- NPVariant unused_result;
- NPAPIClient::PluginClient::HostFunctions()->evaluate(
- id(), window_obj, &script_string, &unused_result);
-
- return len;
-}
-
-NPError ExecuteStreamJavaScript::DestroyStream(NPStream *stream,
- NPError reason) {
- return NPERR_NO_ERROR;
-}
-
-} // namespace NPAPIClient
« no previous file with comments | « content/test/plugin/plugin_execute_stream_javascript.h ('k') | content/test/plugin/plugin_get_javascript_url2_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698