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) 2010 Apple Inc. All rights reserved. | 6 * Copyright (C) 2010 Apple Inc. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 using namespace std; | 34 using namespace std; |
35 | 35 |
36 // Passing null for our NPP_GetValue function pointer should not crash. | 36 // Passing null for our NPP_GetValue function pointer should not crash. |
37 | 37 |
38 class NullNPPGetValuePointer : public PluginTest { | 38 class NullNPPGetValuePointer : public PluginTest { |
39 public: | 39 public: |
40 NullNPPGetValuePointer(NPP, const string& identifier); | 40 NullNPPGetValuePointer(NPP, const string& identifier); |
41 | 41 |
42 private: | 42 private: |
43 virtual NPError NPP_Destroy(NPSavedData**) override; | 43 NPError NPP_Destroy(NPSavedData**) override; |
44 virtual NPError NPP_GetValue(NPPVariable, void* value) override; | 44 NPError NPP_GetValue(NPPVariable, void* value) override; |
45 | 45 |
46 NPP_GetValueProcPtr m_originalNPPGetValuePointer; | 46 NPP_GetValueProcPtr m_originalNPPGetValuePointer; |
47 }; | 47 }; |
48 | 48 |
49 static PluginTest::Register<NullNPPGetValuePointer> registrar("null-npp-getvalue
-pointer"); | 49 static PluginTest::Register<NullNPPGetValuePointer> registrar("null-npp-getvalue
-pointer"); |
50 | 50 |
51 NullNPPGetValuePointer::NullNPPGetValuePointer(NPP npp, const string& identifier
) | 51 NullNPPGetValuePointer::NullNPPGetValuePointer(NPP npp, const string& identifier
) |
52 : PluginTest(npp, identifier) | 52 : PluginTest(npp, identifier) |
53 , m_originalNPPGetValuePointer(pluginFunctions->getvalue) | 53 , m_originalNPPGetValuePointer(pluginFunctions->getvalue) |
54 { | 54 { |
(...skipping 10 matching lines...) Expand all Loading... |
65 // up future uses of the plugin module. | 65 // up future uses of the plugin module. |
66 pluginFunctions->getvalue = m_originalNPPGetValuePointer; | 66 pluginFunctions->getvalue = m_originalNPPGetValuePointer; |
67 return NPERR_NO_ERROR; | 67 return NPERR_NO_ERROR; |
68 } | 68 } |
69 | 69 |
70 NPError NullNPPGetValuePointer::NPP_GetValue(NPPVariable, void*) | 70 NPError NullNPPGetValuePointer::NPP_GetValue(NPPVariable, void*) |
71 { | 71 { |
72 pluginLog(m_npp, "NPP_GetValue was called but should not have been. Maybe We
bKit copied the NPPluginFuncs struct, which would invalidate this test."); | 72 pluginLog(m_npp, "NPP_GetValue was called but should not have been. Maybe We
bKit copied the NPPluginFuncs struct, which would invalidate this test."); |
73 return NPERR_GENERIC_ERROR; | 73 return NPERR_GENERIC_ERROR; |
74 } | 74 } |
OLD | NEW |