| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 // Shared by the plugin DLL and the unittest code. | |
| 5 | |
| 6 #ifndef CHROME_TEST_CHROME_PLUGIN_TEST_CHROME_PLUGIN_H__ | |
| 7 #define CHROME_TEST_CHROME_PLUGIN_TEST_CHROME_PLUGIN_H__ | |
| 8 #pragma once | |
| 9 | |
| 10 #include <string> | |
| 11 | |
| 12 #include "base/basictypes.h" | |
| 13 #include "chrome/common/chrome_plugin_api.h" | |
| 14 | |
| 15 class GURL; | |
| 16 | |
| 17 struct TestResponsePayload { | |
| 18 const char* url; | |
| 19 bool async; | |
| 20 int status; | |
| 21 const char* mime_type; | |
| 22 const char* body; | |
| 23 }; | |
| 24 | |
| 25 const char kChromeTestPluginProtocol[] = "cptest"; | |
| 26 | |
| 27 const TestResponsePayload kChromeTestPluginPayloads[] = { | |
| 28 { | |
| 29 "cptest:sync", | |
| 30 false, | |
| 31 200, | |
| 32 "text/html", | |
| 33 "<head><title>cptest:sync</title></head><body>SUCCESS</body>" | |
| 34 }, | |
| 35 { | |
| 36 "cptest:async", | |
| 37 true, | |
| 38 200, | |
| 39 "text/plain", | |
| 40 "<head><title>cptest:async</title></head><body>SUCCESS</body>" | |
| 41 }, | |
| 42 { | |
| 43 "cptest:blank", | |
| 44 false, | |
| 45 200, | |
| 46 "text/plain", | |
| 47 "" | |
| 48 }, | |
| 49 }; | |
| 50 | |
| 51 struct TestFuncParams { | |
| 52 typedef void (STDCALL *CallbackFunc)(void* data); | |
| 53 | |
| 54 struct PluginFuncs { | |
| 55 int (STDCALL *test_make_request)(const char* method, const GURL& url); | |
| 56 }; | |
| 57 PluginFuncs pfuncs; | |
| 58 | |
| 59 struct BrowserFuncs { | |
| 60 void (STDCALL *test_complete)(CPRequest* request, bool success, | |
| 61 const std::string& raw_headers, | |
| 62 const std::string& body); | |
| 63 void (STDCALL *invoke_later)(CallbackFunc callback, void* callback_data, | |
| 64 int delay_ms); | |
| 65 }; | |
| 66 BrowserFuncs bfuncs; | |
| 67 }; | |
| 68 | |
| 69 const char kChromeTestPluginPostData[] = "Test Data"; | |
| 70 | |
| 71 #endif // CHROME_TEST_CHROME_PLUGIN_TEST_CHROME_PLUGIN_H__ | |
| OLD | NEW |