Refactor management of overview window copy lifetime into a separate class.
[chromium-blink-merge.git] / content / test / plugin / plugin_request_read_test.h
blob67c8a70984d681fe05c4b3d62bb8de955c42842b
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.
5 #ifndef CONTENT_TEST_PLUGIN_PLUGIN_REQUEST_READ_TEST_H_
6 #define CONTENT_TEST_PLUGIN_PLUGIN_REQUEST_READ_TEST_H_
8 #include <string>
9 #include <vector>
11 #include "base/compiler_specific.h"
12 #include "content/test/plugin/plugin_test.h"
14 namespace NPAPIClient {
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);
21 virtual ~PluginRequestReadTest();
24 // NPAPI Functions
26 virtual NPError New(uint16 mode, int16 argc, const char* argn[],
27 const char* argv[], NPSavedData* saved) OVERRIDE;
28 virtual NPError SetWindow(NPWindow* window) OVERRIDE;
29 virtual NPError NewStream(NPMIMEType type, NPStream* stream,
30 NPBool seekable, uint16* stream_type) OVERRIDE;
31 virtual NPError DestroyStream(NPStream *stream, NPError reason) OVERRIDE;
32 virtual int32 WriteReady(NPStream* stream) OVERRIDE;
33 virtual int32 Write(NPStream* stream, int32 offset, int32 len,
34 void* buffer) OVERRIDE;
36 private:
37 // Tracks ranges, which we requested, but for which we did not get response.
38 std::vector<NPByteRange> requested_ranges_;
39 std::string url_to_request_;
40 bool tests_started_;
41 bool read_requested_;
44 } // namespace NPAPIClient
46 #endif // CONTENT_TEST_PLUGIN_PLUGIN_REQUEST_READ_TEST_H_