Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1703)

Unified Diff: third_party/grpc/test/core/bad_client/bad_client.h

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/grpc/test/build/zookeeper.c ('k') | third_party/grpc/test/core/bad_client/bad_client.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 */
« no previous file with comments | « third_party/grpc/test/build/zookeeper.c ('k') | third_party/grpc/test/core/bad_client/bad_client.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698