[email protected] | d9e440ce | 2013-07-15 13:48:51 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | a4009af | 2013-07-19 05:20:24 | [diff] [blame] | 5 | #ifndef CONTENT_TEST_PLUGIN_PLUGIN_REQUEST_READ_TEST_H_ |
| 6 | #define CONTENT_TEST_PLUGIN_PLUGIN_REQUEST_READ_TEST_H_ |
[email protected] | d9e440ce | 2013-07-15 13:48:51 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include "base/compiler_specific.h" |
[email protected] | a4009af | 2013-07-19 05:20:24 | [diff] [blame] | 12 | #include "content/test/plugin/plugin_test.h" |
[email protected] | d9e440ce | 2013-07-15 13:48:51 | [diff] [blame] | 13 | |
| 14 | namespace NPAPIClient { |
| 15 | |
| 16 | // Tests whether the browser correctly handles single range requests from NPAPI |
| 17 | // plugins. |
| 18 | class PluginRequestReadTest : public PluginTest { |
| 19 | public: |
| 20 | PluginRequestReadTest(NPP id, NPNetscapeFuncs* host_functions); |
dcheng | e933b3eb | 2014-10-21 11:44:09 | [diff] [blame^] | 21 | ~PluginRequestReadTest() override; |
[email protected] | d9e440ce | 2013-07-15 13:48:51 | [diff] [blame] | 22 | |
| 23 | // |
| 24 | // NPAPI Functions |
| 25 | // |
dcheng | e933b3eb | 2014-10-21 11:44:09 | [diff] [blame^] | 26 | NPError New(uint16 mode, |
| 27 | int16 argc, |
| 28 | const char* argn[], |
| 29 | const char* argv[], |
| 30 | NPSavedData* saved) override; |
| 31 | NPError SetWindow(NPWindow* window) override; |
| 32 | NPError NewStream(NPMIMEType type, |
| 33 | NPStream* stream, |
| 34 | NPBool seekable, |
| 35 | uint16* stream_type) override; |
| 36 | NPError DestroyStream(NPStream* stream, NPError reason) override; |
| 37 | int32 WriteReady(NPStream* stream) override; |
| 38 | int32 Write(NPStream* stream, int32 offset, int32 len, void* buffer) override; |
[email protected] | d9e440ce | 2013-07-15 13:48:51 | [diff] [blame] | 39 | |
| 40 | private: |
| 41 | // Tracks ranges, which we requested, but for which we did not get response. |
| 42 | std::vector<NPByteRange> requested_ranges_; |
| 43 | std::string url_to_request_; |
| 44 | bool tests_started_; |
| 45 | bool read_requested_; |
| 46 | }; |
| 47 | |
| 48 | } // namespace NPAPIClient |
| 49 | |
[email protected] | a4009af | 2013-07-19 05:20:24 | [diff] [blame] | 50 | #endif // CONTENT_TEST_PLUGIN_PLUGIN_REQUEST_READ_TEST_H_ |
[email protected] | d9e440ce | 2013-07-15 13:48:51 | [diff] [blame] | 51 | |