Index: third_party/grpc/src/objective-c/tests/InteropTestsLocalSSL.m |
diff --git a/third_party/WebKit/Source/core/svg/SVGGeometryElement.h b/third_party/grpc/src/objective-c/tests/InteropTestsLocalSSL.m |
similarity index 58% |
copy from third_party/WebKit/Source/core/svg/SVGGeometryElement.h |
copy to third_party/grpc/src/objective-c/tests/InteropTestsLocalSSL.m |
index 04a8371aa34306e13589edb4d2725e4331e6b768..155e334ecb2bec5ab0552293e7eb78e4c33b295f 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGGeometryElement.h |
+++ b/third_party/grpc/src/objective-c/tests/InteropTestsLocalSSL.m |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
+ * |
+ * Copyright 2015-2016, 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,42 +28,44 @@ |
* 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 SVGGeometryElement_h |
-#define SVGGeometryElement_h |
- |
-#include "core/svg/SVGGraphicsElement.h" |
- |
-namespace blink { |
+#import <GRPCClient/GRPCCall+Tests.h> |
-class SVGPointTearOff; |
+#import "InteropTests.h" |
-class SVGGeometryElement : public SVGGraphicsElement { |
- DEFINE_WRAPPERTYPEINFO(); |
-public: |
- virtual Path asPath() const = 0; |
- bool isPointInFill(SVGPointTearOff*) const; |
- bool isPointInStroke(SVGPointTearOff*) const; |
+static NSString * const kLocalSSLHost = @"localhost:5051"; |
- void toClipPath(Path&) const; |
+/** Tests in InteropTests.m, sending the RPCs to a local SSL server. */ |
+@interface InteropTestsLocalSSL : InteropTests |
+@end |
- LayoutObject* createLayoutObject(const ComputedStyle&) override; |
+@implementation InteropTestsLocalSSL |
-protected: |
- SVGGeometryElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElement); |
++ (NSString *)host { |
+ return kLocalSSLHost; |
+} |
-private: |
- bool isSVGGeometryElement() const final { return true; } |
-}; |
+- (void)setUp { |
+ // Register test server certificates and name. |
+ NSBundle *bundle = [NSBundle bundleForClass:self.class]; |
+ NSString *certsPath = [bundle pathForResource:@"TestCertificates.bundle/test-certificates" |
+ ofType:@"pem"]; |
+ [GRPCCall useTestCertsPath:certsPath testName:@"foo.test.google.fr" forHost:kLocalSSLHost]; |
-inline bool isSVGGeometryElement(const SVGElement& element) |
-{ |
- return element.isSVGGeometryElement(); |
+ [super setUp]; |
} |
-DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGGeometryElement); |
- |
-} // namespace blink |
+- (void)testExceptions { |
+ // Try to set userAgentPrefix for host that is nil. This should cause |
+ // an exception. |
+ @try { |
+ [GRPCCall useTestCertsPath:nil testName:nil forHost:nil]; |
+ XCTFail(@"Did not receive an exception when parameters are nil"); |
+ } @catch(NSException *theException) { |
+ NSLog(@"Received exception as expected: %@", theException.name); |
+ } |
+} |
-#endif // SVGGeometryElement_h |
+@end |