summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 17:13:37 +0000
committerjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 17:13:37 +0000
commit22baf143d9211ec794f884ec5341481f950818ef (patch)
tree536a1bace59c8b4f2e6976ff83d455f39dee64c2
parent9a862589370681281d9e2875b7250e1e7d394903 (diff)
downloadchromium_src-22baf143d9211ec794f884ec5341481f950818ef.zip
chromium_src-22baf143d9211ec794f884ec5341481f950818ef.tar.gz
chromium_src-22baf143d9211ec794f884ec5341481f950818ef.tar.bz2
Add layout test plugin functions required for plugins/netscape-plugin-property-access-exception.html and rebaseline.
BUG=35115 TEST=!red Review URL: http://codereview.chromium.org/660390 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40520 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt10
-rw-r--r--webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt10
-rw-r--r--webkit/tools/layout_tests/test_expectations.txt1
-rw-r--r--webkit/tools/npapi_layout_test_plugin/PluginObject.cpp22
4 files changed, 40 insertions, 3 deletions
diff --git a/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt
new file mode 100644
index 0000000..2b68fe8
--- /dev/null
+++ b/webkit/data/layout_tests/platform/chromium-mac/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt
@@ -0,0 +1,10 @@
+CONSOLE MESSAGE: line 1: Uncaught Error: plugin object testThrowExceptionProperty SUCCESS
+CONSOLE MESSAGE: line 1: Uncaught Error: plugin object testThrowExceptionProperty SUCCESS
+
+SUCCESS: Exception caught: Error: plugin object testThrowExceptionProperty SUCCESS
+SUCCESS: Exception caught: Error: plugin object testThrowExceptionProperty SUCCESS
+One could expect exceptions to be raised in the below cases, too - but Firefox doesn't do that in most of these (I do get an exception in the first case, but that's inconsistent with not getting it in the seconfd one).
+Exception caught: Error: Error calling method on NPObject!
+Exception caught: Error: Error calling method on NPObject!
+Exception caught: Error: plugin object testThrowExceptionProperty SUCCESS
+Exception caught: Error: plugin object testThrowExceptionProperty SUCCESS
diff --git a/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt
new file mode 100644
index 0000000..2b68fe8
--- /dev/null
+++ b/webkit/data/layout_tests/platform/chromium-win/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt
@@ -0,0 +1,10 @@
+CONSOLE MESSAGE: line 1: Uncaught Error: plugin object testThrowExceptionProperty SUCCESS
+CONSOLE MESSAGE: line 1: Uncaught Error: plugin object testThrowExceptionProperty SUCCESS
+
+SUCCESS: Exception caught: Error: plugin object testThrowExceptionProperty SUCCESS
+SUCCESS: Exception caught: Error: plugin object testThrowExceptionProperty SUCCESS
+One could expect exceptions to be raised in the below cases, too - but Firefox doesn't do that in most of these (I do get an exception in the first case, but that's inconsistent with not getting it in the seconfd one).
+Exception caught: Error: Error calling method on NPObject!
+Exception caught: Error: Error calling method on NPObject!
+Exception caught: Error: plugin object testThrowExceptionProperty SUCCESS
+Exception caught: Error: plugin object testThrowExceptionProperty SUCCESS
diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt
index 3d4c5ea..efe28e3 100644
--- a/webkit/tools/layout_tests/test_expectations.txt
+++ b/webkit/tools/layout_tests/test_expectations.txt
@@ -2790,7 +2790,6 @@ BUG35240 MAC : svg/custom/use-clipped-hit.svg = IMAGE
// WebKit roll 54493 to 54530: new tests.
BUG35114 : fast/js/parser-syntax-check.html = TEXT
-BUG35115 : plugins/netscape-plugin-property-access-exception.html = TEXT
// WebKit roll 54530 to 54550
BUG35238 MAC : fast/dom/clone-node-dynamic-style.html = IMAGE
diff --git a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp
index 922faf3..4b310ef 100644
--- a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp
+++ b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp
@@ -126,7 +126,8 @@ static bool identifiersInitialized = false;
#define ID_PROPERTY_LOG_DESTROY 4
#define ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM 5
#define ID_PROPERTY_TEST_OBJECT_COUNT 6
-#define NUM_PROPERTY_IDENTIFIERS 7
+#define ID_PROPERTY_THROW_EXCEPTION_PROPERTY 7
+#define NUM_PROPERTY_IDENTIFIERS 8
static NPIdentifier pluginPropertyIdentifiers[NUM_PROPERTY_IDENTIFIERS];
static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = {
@@ -137,6 +138,7 @@ static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = {
"logDestroy",
"returnErrorFromNewStream",
"testObjectCount",
+ "testThrowExceptionProperty",
};
enum {
@@ -167,6 +169,8 @@ enum {
ID_TEST_HAS_METHOD,
ID_TEST_THROW_EXCEPTION_METHOD,
ID_TEST_FAIL_METHOD,
+ ID_TEST_GET_BROWSER_PROPERTY,
+ ID_TEST_SET_BROWSER_PROPERTY,
NUM_METHOD_IDENTIFIERS
};
@@ -199,7 +203,9 @@ static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = {
"testHasProperty",
"testHasMethod",
"testThrowException",
- "testFail"
+ "testFail",
+ "testGetBrowserProperty",
+ "testSetBrowserProperty"
};
static NPUTF8* createCStringFromNPVariant(const NPVariant* variant)
@@ -259,6 +265,9 @@ static bool pluginGetProperty(NPObject* obj, NPIdentifier name, NPVariant* resul
} else if (name == pluginPropertyIdentifiers[ID_PROPERTY_TEST_OBJECT_COUNT]) {
INT32_TO_NPVARIANT(getTestObjectCount(), *result);
return true;
+ } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) {
+ browser->setexception(obj, "plugin object testThrowExceptionProperty SUCCESS");
+ return true;
}
return false;
}
@@ -275,6 +284,9 @@ static bool pluginSetProperty(NPObject* obj, NPIdentifier name, const NPVariant*
} else if (name == pluginPropertyIdentifiers[ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM]) {
plugin->returnErrorFromNewStream = NPVARIANT_TO_BOOLEAN(*variant);
return true;
+ } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) {
+ browser->setexception(obj, "plugin object testThrowExceptionProperty SUCCESS");
+ return true;
}
return false;
@@ -921,6 +933,12 @@ static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* a
else if (name == pluginMethodIdentifiers[ID_TEST_THROW_EXCEPTION_METHOD]) {
browser->setexception(header, "plugin object testThrowException SUCCESS");
return true;
+ } else if (name == pluginMethodIdentifiers[ID_TEST_GET_BROWSER_PROPERTY]) {
+ browser->getproperty(plugin->npp, NPVARIANT_TO_OBJECT(args[0]), stringVariantToIdentifier(args[1]), result);
+ return true;
+ } else if (name == pluginMethodIdentifiers[ID_TEST_SET_BROWSER_PROPERTY]) {
+ browser->setproperty(plugin->npp, NPVARIANT_TO_OBJECT(args[0]), stringVariantToIdentifier(args[1]), &args[2]);
+ return true;
}// else if (name == pluginMethodIdentifiers[ID_TEST_FAIL_METHOD])
// return browser->invoke(plugin->npp, 0, name, args, argCount, result);