| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef WEBKIT_PORT_PLUGINS_TEST_PLUGIN_GETURL_TEST_H__ | 5 #ifndef WEBKIT_PORT_PLUGINS_TEST_PLUGIN_GETURL_TEST_H__ |
| 6 #define WEBKIT_PORT_PLUGINS_TEST_PLUGIN_GETURL_TEST_H__ | 6 #define WEBKIT_PORT_PLUGINS_TEST_PLUGIN_GETURL_TEST_H__ |
| 7 | 7 |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 | 9 |
| 10 #include "webkit/glue/plugins/test/plugin_test.h" | 10 #include "webkit/glue/plugins/test/plugin_test.h" |
| 11 | 11 |
| 12 namespace NPAPIClient { | 12 namespace NPAPIClient { |
| 13 | 13 |
| 14 // The PluginGetURLTest test functionality of the NPN_GetURL | 14 // The PluginGetURLTest test functionality of the NPN_GetURL |
| 15 // and NPN_GetURLNotify methods. | 15 // and NPN_GetURLNotify methods. |
| 16 // | 16 // |
| 17 // This test first discovers it's URL by sending a GetURL request | 17 // This test first discovers it's URL by sending a GetURL request |
| 18 // for 'javascript:top.location'. After receiving that, the | 18 // for 'javascript:top.location'. After receiving that, the |
| 19 // test will request the url itself (again via GetURL). | 19 // test will request the url itself (again via GetURL). |
| 20 class PluginGetURLTest : public PluginTest { | 20 class PluginGetURLTest : public PluginTest { |
| 21 public: | 21 public: |
| 22 // Constructor. | 22 // Constructor. |
| 23 PluginGetURLTest(NPP id, NPNetscapeFuncs *host_functions); | 23 PluginGetURLTest(NPP id, NPNetscapeFuncs *host_functions); |
| 24 | 24 |
| 25 // | 25 // |
| 26 // NPAPI functions | 26 // NPAPI functions |
| 27 // | 27 // |
| 28 virtual NPError New(uint16 mode, int16 argc, const char* argn[], |
| 29 const char* argv[], NPSavedData* saved); |
| 28 virtual NPError SetWindow(NPWindow* pNPWindow); | 30 virtual NPError SetWindow(NPWindow* pNPWindow); |
| 29 virtual NPError NewStream(NPMIMEType type, NPStream* stream, | 31 virtual NPError NewStream(NPMIMEType type, NPStream* stream, |
| 30 NPBool seekable, uint16* stype); | 32 NPBool seekable, uint16* stype); |
| 31 virtual int32 WriteReady(NPStream *stream); | 33 virtual int32 WriteReady(NPStream *stream); |
| 32 virtual int32 Write(NPStream *stream, int32 offset, int32 len, | 34 virtual int32 Write(NPStream *stream, int32 offset, int32 len, |
| 33 void *buffer); | 35 void *buffer); |
| 34 virtual NPError DestroyStream(NPStream *stream, NPError reason); | 36 virtual NPError DestroyStream(NPStream *stream, NPError reason); |
| 35 virtual void StreamAsFile(NPStream* stream, const char* fname); | 37 virtual void StreamAsFile(NPStream* stream, const char* fname); |
| 36 virtual void URLNotify(const char* url, NPReason reason, void* data); | 38 virtual void URLNotify(const char* url, NPReason reason, void* data); |
| 37 | 39 |
| 38 private: | 40 private: |
| 39 bool tests_started_; | 41 bool tests_started_; |
| 40 int tests_in_progress_; | 42 int tests_in_progress_; |
| 41 std::string self_url_; | 43 std::string self_url_; |
| 42 FILE* test_file_; | 44 FILE* test_file_; |
| 45 bool expect_404_response_; |
| 46 // This flag is set to true in the context of the NPN_Evaluate call. |
| 47 bool npn_evaluate_context_; |
| 48 std::string page_not_found_url_; |
| 43 }; | 49 }; |
| 44 | 50 |
| 45 } // namespace NPAPIClient | 51 } // namespace NPAPIClient |
| 46 | 52 |
| 47 #endif // WEBKIT_PORT_PLUGINS_TEST_PLUGIN_GETURL_TEST_H__ | 53 #endif // WEBKIT_PORT_PLUGINS_TEST_PLUGIN_GETURL_TEST_H__ |
| OLD | NEW |