OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /* | 5 /* |
6 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * Copyright (C) 2009 Holger Hans Peter Freyther | 7 * Copyright (C) 2009 Holger Hans Peter Freyther |
8 * Copyright (C) 2010 Collabora Ltd. | 8 * Copyright (C) 2010 Collabora Ltd. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 13 matching lines...) Expand all Loading... |
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
26 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 26 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
27 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #include "PluginObject.h" | 32 #include "PluginObject.h" |
33 | 33 |
34 #include "PluginTest.h" | |
35 #include "content/shell/tools/plugin/test_object.h" | |
36 #include "base/strings/string_util.h" | |
37 #include <assert.h> | 34 #include <assert.h> |
| 35 #include <stddef.h> |
| 36 #include <stdint.h> |
38 #include <stdio.h> | 37 #include <stdio.h> |
39 #include <stdlib.h> | 38 #include <stdlib.h> |
40 #include <string.h> | 39 #include <string.h> |
41 | 40 |
| 41 #include "PluginTest.h" |
| 42 #include "base/strings/string_util.h" |
| 43 #include "content/shell/tools/plugin/test_object.h" |
| 44 |
42 // Helper function which takes in the plugin window object for logging to the | 45 // Helper function which takes in the plugin window object for logging to the |
43 // console object. | 46 // console object. |
44 static void pluginLogWithWindowObject(NPObject* windowObject, | 47 static void pluginLogWithWindowObject(NPObject* windowObject, |
45 NPP instance, | 48 NPP instance, |
46 const char* message) { | 49 const char* message) { |
47 NPVariant consoleVariant; | 50 NPVariant consoleVariant; |
48 if (!browser->getproperty(instance, | 51 if (!browser->getproperty(instance, |
49 windowObject, | 52 windowObject, |
50 browser->getstringidentifier("console"), | 53 browser->getstringidentifier("console"), |
51 &consoleVariant)) { | 54 &consoleVariant)) { |
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 DOUBLE_TO_NPVARIANT(242.242, args[4]); | 1482 DOUBLE_TO_NPVARIANT(242.242, args[4]); |
1480 STRINGZ_TO_NPVARIANT("Hello, World", args[5]); | 1483 STRINGZ_TO_NPVARIANT("Hello, World", args[5]); |
1481 OBJECT_TO_NPVARIANT(windowScriptObject, args[6]); | 1484 OBJECT_TO_NPVARIANT(windowScriptObject, args[6]); |
1482 | 1485 |
1483 NPVariant result; | 1486 NPVariant result; |
1484 if (browser->invoke(npp, windowScriptObject, testNPInvoke, args, 7, &result)) | 1487 if (browser->invoke(npp, windowScriptObject, testNPInvoke, args, 7, &result)) |
1485 browser->releasevariantvalue(&result); | 1488 browser->releasevariantvalue(&result); |
1486 | 1489 |
1487 browser->releaseobject(windowScriptObject); | 1490 browser->releaseobject(windowScriptObject); |
1488 } | 1491 } |
OLD | NEW |