summaryrefslogtreecommitdiffstats
path: root/webkit/tools/pepper_test_plugin
diff options
context:
space:
mode:
authordspringer@google.com <dspringer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-14 20:40:43 +0000
committerdspringer@google.com <dspringer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-14 20:40:43 +0000
commit596b2c45d080cd8e409b0b7de75ca1b8d77d7c73 (patch)
tree5d4c3c81cd20d84c01e0364780479869046d21c9 /webkit/tools/pepper_test_plugin
parent4fd333306b87fa9f716c934b16351bc2291c79e2 (diff)
downloadchromium_src-596b2c45d080cd8e409b0b7de75ca1b8d77d7c73.zip
chromium_src-596b2c45d080cd8e409b0b7de75ca1b8d77d7c73.tar.gz
chromium_src-596b2c45d080cd8e409b0b7de75ca1b8d77d7c73.tar.bz2
Make the Pepepr test run on the mac.
BUG=none TESTS=none Review URL: http://codereview.chromium.org/546041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/pepper_test_plugin')
-rw-r--r--webkit/tools/pepper_test_plugin/Info.plist46
-rw-r--r--webkit/tools/pepper_test_plugin/README26
-rw-r--r--webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp74
-rw-r--r--webkit/tools/pepper_test_plugin/plugin_object.cc8
-rw-r--r--webkit/tools/pepper_test_plugin/test_page.html8
5 files changed, 133 insertions, 29 deletions
diff --git a/webkit/tools/pepper_test_plugin/Info.plist b/webkit/tools/pepper_test_plugin/Info.plist
new file mode 100644
index 0000000..2f215ef
--- /dev/null
+++ b/webkit/tools/pepper_test_plugin/Info.plist
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Copyright 2010 Google, Inc.</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.google.testpepperplugin</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>BRPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>CFPlugInDynamicRegisterFunction</key>
+ <string></string>
+ <key>CFPlugInDynamicRegistration</key>
+ <string>NO</string>
+ <key>WebPluginDescription</key>
+ <string>Simple Pepper plug-in that handles tests</string>
+ <key>WebPluginMIMETypes</key>
+ <dict>
+ <key>pepper-application/x-pepper-test-plugin</key>
+ <dict>
+ <key>WebPluginExtensions</key>
+ <array>
+ <string>testpepper</string>
+ </array>
+ <key>WebPluginTypeDescription</key>
+ <string>Test Pepper API</string>
+ </dict>
+ </dict>
+ <key>WebPluginName</key>
+ <string>Pepper Test PlugIn</string>
+</dict>
+</plist>
diff --git a/webkit/tools/pepper_test_plugin/README b/webkit/tools/pepper_test_plugin/README
index 4c8003b..76062bd 100644
--- a/webkit/tools/pepper_test_plugin/README
+++ b/webkit/tools/pepper_test_plugin/README
@@ -14,3 +14,29 @@ generated pepper_test_plugin project.
Note that pepper_test_plugin is not dependent on the chrome project so you
need to remember to build Chrome separately if necessary.
+
+- Mac Instructions -
+In the pepper_test_plugin.xcodeproj that gets generated in this dir by GYP:
+
+[There isn't a way to add an Xcode Custom Executable via GYP, so you have to do
+this by hand each time the .xcoeproj is generated. Sorry.]
+
+Right (ctrl)-click 'Executables', then "Add -> New Custom Executable..."
+Call the Executable "Chromium"
+Set the Executable Path to ${BUILT_PRODUCTS_DIR}/Chromium.app/Contents/MacOS/Chromium
+When the Info panel comes up, add these arguments using the '+' button:
+ --no-sandbox
+ --internal-pepper
+ file://${SRCROOT}/test_page.html
+ # Add this if you want Chromium to pause before loading a render view.
+ --renderer-startup-dialog
+ # Add this to run Chromium as a single process.
+ --single-process
+
+Before you run the executable, copy the plugin into the Chromium.app bundle,
+into Chromium.app/Contents/PlugIns. You might have to create the PlugIns
+directory first.
+
+Once all this is set up, you can use "Build and run" (or cmd-r) in Xcode to
+run the pepper plugin test.
+
diff --git a/webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp b/webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp
index 9383747..7a8320a 100644
--- a/webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp
+++ b/webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp
@@ -1,18 +1,36 @@
+# Copyright (c) 2010 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.
+
{
'targets': [
{
'target_name': 'pepper_test_plugin',
- 'type': 'shared_library',
'dependencies': [
'../../../third_party/npapi/npapi.gyp:npapi',
],
'include_dirs': [
'../../..', # Root of Chrome Checkout
],
+ 'xcode_settings': {
+ 'INFOPLIST_FILE': 'Info.plist',
+ },
+ 'sources': [
+ 'command_buffer_pepper.cc',
+ 'command_buffer_pepper.h',
+ 'main.cc',
+ 'plugin_object.cc',
+ 'plugin_object.h',
+ 'test_object.cc',
+ 'test_object.h',
+ 'event_handler.cc',
+ 'event_handler.h'
+ ],
'conditions': [
['OS=="win"', {
'product_name': 'pepper_test_plugin',
+ 'type': 'shared_library',
'msvs_guid': 'EE00E36E-9E8C-4DFB-925E-FBE32CEDB91A',
'dependencies': [
'../../../gpu/gpu.gyp:gles2_demo_lib',
@@ -21,8 +39,19 @@
'pepper_test_plugin.def',
'pepper_test_plugin.rc',
],
+ 'run_as': {
+ 'action': [
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)chrome<(EXECUTABLE_SUFFIX)',
+ '--no-sandbox',
+ '--internal-pepper',
+ '--enable-gpu-plugin',
+ '--load-plugin=$(TargetPath)',
+ 'file://$(ProjectDir)test_page.html',
+ ],
+ },
}],
['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
+ 'product_name': 'pepper_test_plugin',
# Shared libraries need -fPIC on x86-64
'cflags': ['-fPIC'],
'defines': ['INDEPENDENT_PLUGIN'],
@@ -32,28 +61,27 @@
'../../../skia/skia.gyp:skia',
],
}],
+ ['OS=="mac"', {
+ 'type': 'loadable_module',
+ 'mac_bundle': 1,
+ 'product_name': 'PepperTestPlugin',
+ 'product_extension': 'plugin',
+ 'defines': ['INDEPENDENT_PLUGIN'],
+ 'sources+': [
+ 'Info.plist'
+ ],
+ }],
],
- 'sources': [
- 'command_buffer_pepper.cc',
- 'command_buffer_pepper.h',
- 'main.cc',
- 'plugin_object.cc',
- 'plugin_object.h',
- 'test_object.cc',
- 'test_object.h',
- 'event_handler.cc',
- 'event_handler.h'
- ],
- 'run_as': {
- 'action': [
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)chrome<(EXECUTABLE_SUFFIX)',
- '--no-sandbox',
- '--internal-pepper',
- '--enable-gpu-plugin',
- '--load-plugin=$(TargetPath)',
- 'file://$(ProjectDir)test_page.html',
- ],
- },
- }
+ # See README for instructions on how to run and debug on the Mac.
+ #'conditions' : [
+ # ['OS=="mac"', {
+ # 'target_name' : 'Chromium',
+ # 'type' : 'executable',
+ # 'xcode_settings' : {
+ # 'ARGUMENTS' : '--renderer-startup-dialog --internal-pepper --no-sandbox file://${SRCROOT}/test_page.html'
+ # },
+ # }],
+ #],
+ },
],
}
diff --git a/webkit/tools/pepper_test_plugin/plugin_object.cc b/webkit/tools/pepper_test_plugin/plugin_object.cc
index 01a4540..af199a7 100644
--- a/webkit/tools/pepper_test_plugin/plugin_object.cc
+++ b/webkit/tools/pepper_test_plugin/plugin_object.cc
@@ -25,9 +25,9 @@
#include "webkit/tools/pepper_test_plugin/plugin_object.h"
+#include <stdio.h>
#include <cmath>
#include <limits>
-#include <stdio.h>
#include <string>
#if defined(INDEPENDENT_PLUGIN)
@@ -56,7 +56,8 @@ enum {
};
static NPIdentifier plugin_property_identifiers[NUM_PROPERTY_IDENTIFIERS];
-static const NPUTF8* plugin_property_identifier_names[NUM_PROPERTY_IDENTIFIERS] = {
+static const NPUTF8*
+ plugin_property_identifier_names[NUM_PROPERTY_IDENTIFIERS] = {
"property",
"testObject",
};
@@ -400,12 +401,11 @@ void PluginObject::Draw3D() {
bool PluginObject::InitializeCommandBuffer() {
#if !defined(INDEPENDENT_PLUGIN)
- const static int32 kCommandBufferSize = 512 * 1024;
+ static const int32 kCommandBufferSize = 512 * 1024;
command_buffer_.reset(new CommandBufferPepper(npp_, browser));
if (command_buffer_->Initialize(kCommandBufferSize)) {
helper_.reset(new gpu::gles2::GLES2CmdHelper(command_buffer_.get()));
if (helper_->Initialize()) {
-
const int32 kTransferBufferSize = 512 * 1024;
int32 transfer_buffer_id =
command_buffer_->CreateTransferBuffer(kTransferBufferSize);
diff --git a/webkit/tools/pepper_test_plugin/test_page.html b/webkit/tools/pepper_test_plugin/test_page.html
index f9bf2b8..5a3e609 100644
--- a/webkit/tools/pepper_test_plugin/test_page.html
+++ b/webkit/tools/pepper_test_plugin/test_page.html
@@ -11,8 +11,12 @@ var addLine = function(line) {
var runScripts = function() {
event_box = document.getElementById("event_text_box");;
var plugin_obj = document.getElementById("plugin");
- addLine('<b>Event log</b>');
- plugin_obj.setTextBox(addLine);
+ if (plugin_obj.setTextBox) {
+ addLine('<b>Event log</b>');
+ plugin_obj.setTextBox(addLine);
+ } else {
+ alert('Plugin failed to load.');
+ }
}
</script>
</head>