Index: third_party/grpc/test/core/bad_client/bad_client.h |
diff --git a/third_party/WebKit/Source/platform/blob/BlobURL.h b/third_party/grpc/test/core/bad_client/bad_client.h |
similarity index 57% |
copy from third_party/WebKit/Source/platform/blob/BlobURL.h |
copy to third_party/grpc/test/core/bad_client/bad_client.h |
index 4a17be502459e397e2543644aa0e6a9ae197d4db..19ddba83bf01145b5925310a104b82662a9fce39 100644 |
--- a/third_party/WebKit/Source/platform/blob/BlobURL.h |
+++ b/third_party/grpc/test/core/bad_client/bad_client.h |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (C) 2010 Google Inc. All rights reserved. |
+ * |
+ * Copyright 2015, Google Inc. |
+ * All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -26,40 +28,34 @@ |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+ * |
*/ |
-#ifndef BlobURL_h |
-#define BlobURL_h |
+#ifndef GRPC_TEST_CORE_BAD_CLIENT_BAD_CLIENT_H |
+#define GRPC_TEST_CORE_BAD_CLIENT_BAD_CLIENT_H |
-#include "platform/PlatformExport.h" |
-#include "wtf/Allocator.h" |
-#include "wtf/Forward.h" |
+#include <grpc/grpc.h> |
+#include "test/core/util/test_config.h" |
-namespace blink { |
+#define GRPC_BAD_CLIENT_REGISTERED_METHOD "/registered/bar" |
+#define GRPC_BAD_CLIENT_REGISTERED_HOST "localhost" |
-class KURL; |
-class SecurityOrigin; |
+typedef void (*grpc_bad_client_server_side_validator)(grpc_server *server, |
+ grpc_completion_queue *cq, |
+ void *registered_method); |
-// Public blob URLs are of the form |
-// blob:%escaped_origin%/%UUID% |
-// The origin of the host page is encoded in the URL value to |
-// allow easy lookup of the origin when security checks need to be performed. |
-// When loading blobs via ResourceHandle or when reading blobs via FileReader |
-// the loader conducts security checks that examine the origin of host page |
-// encoded in the blob url. |
-class PLATFORM_EXPORT BlobURL { |
- STATIC_ONLY(BlobURL); |
-public: |
- static KURL createPublicURL(SecurityOrigin*); |
- static String getOrigin(const KURL&); |
+#define GRPC_BAD_CLIENT_DISCONNECT 1 |
- static KURL createInternalStreamURL(); |
+/* Test runner. |
-private: |
- static KURL createBlobURL(const String& originString); |
- static const char kBlobProtocol[]; |
-}; |
+ Create a server, and send client_payload to it as bytes from a client. |
+ Execute validator in a separate thread to assert that the bytes are |
+ handled as expected. */ |
+void grpc_run_bad_client_test(grpc_bad_client_server_side_validator validator, |
+ const char *client_payload, |
+ size_t client_payload_length, uint32_t flags); |
-} // namespace blink |
+#define GRPC_RUN_BAD_CLIENT_TEST(validator, payload, flags) \ |
+ grpc_run_bad_client_test(validator, payload, sizeof(payload) - 1, flags) |
-#endif // BlobURL_h |
+#endif /* GRPC_TEST_CORE_BAD_CLIENT_BAD_CLIENT_H */ |