Index: third_party/grpc/test/cpp/qps/async_unary_ping_pong_test.cc |
diff --git a/third_party/WebKit/Source/core/css/CSSValueTestHelper.h b/third_party/grpc/test/cpp/qps/async_unary_ping_pong_test.cc |
similarity index 56% |
copy from third_party/WebKit/Source/core/css/CSSValueTestHelper.h |
copy to third_party/grpc/test/cpp/qps/async_unary_ping_pong_test.cc |
index 39b526a02aa3dde7741ec7470ec055eb426eca16..d801bddf4acde25c2f12f9cbed25cb84b823dcd5 100644 |
--- a/third_party/WebKit/Source/core/css/CSSValueTestHelper.h |
+++ b/third_party/grpc/test/cpp/qps/async_unary_ping_pong_test.cc |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (c) 2013, Google Inc. 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,51 +28,50 @@ |
* 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. |
+ * |
*/ |
-/** |
- * Make testing with gtest and gmock nicer by adding pretty print and other |
- * helper functions. |
- */ |
- |
-#ifndef CSSValueTestHelper_h |
-#define CSSValueTestHelper_h |
+#include <set> |
-#include "core/css/CSSPrimitiveValue.h" |
-#include "core/css/CSSValue.h" |
+#include <grpc/support/log.h> |
-#include <ostream> |
+#include "test/cpp/qps/driver.h" |
+#include "test/cpp/qps/report.h" |
+#include "test/cpp/util/benchmark_config.h" |
+namespace grpc { |
namespace testing { |
-namespace internal { |
-// gtest tests won't compile with clang when trying to EXPECT_EQ a class that |
-// has the "template<typename T> operator T*()" private. |
-// (See https://code.google.com/p/googletest/issues/detail?id=442) |
-// |
-// Work around is to define this custom IsNullLiteralHelper. |
-char(&IsNullLiteralHelper(const blink::CSSValue&))[2]; |
+static const int WARMUP = 5; |
+static const int BENCHMARK = 10; |
-} |
-} // namespace testing |
+static void RunAsyncUnaryPingPong() { |
+ gpr_log(GPR_INFO, "Running Async Unary Ping Pong"); |
-namespace blink { |
+ ClientConfig client_config; |
+ client_config.set_client_type(ASYNC_CLIENT); |
+ client_config.set_outstanding_rpcs_per_channel(1); |
+ client_config.set_client_channels(1); |
+ client_config.set_async_client_threads(1); |
+ client_config.set_rpc_type(UNARY); |
+ client_config.mutable_load_params()->mutable_closed_loop(); |
-inline bool operator==(const CSSValue& a, const CSSValue& b) |
-{ |
- return a.equals(b); |
-} |
+ ServerConfig server_config; |
+ server_config.set_server_type(ASYNC_SERVER); |
+ server_config.set_async_server_threads(1); |
-inline void PrintTo(const CSSValue& cssValue, ::std::ostream* os, const char* typeName = "CSSValue") |
-{ |
- *os << typeName << "(" << cssValue.cssText().utf8().data() << ")"; |
-} |
+ const auto result = |
+ RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2); |
-inline void PrintTo(const CSSPrimitiveValue& cssValue, ::std::ostream* os, const char* typeName = "CSSPrimitiveValue") |
-{ |
- PrintTo(static_cast<const CSSValue&>(cssValue), os, typeName); |
+ GetReporter()->ReportQPS(*result); |
+ GetReporter()->ReportLatency(*result); |
} |
+} // namespace testing |
+} // namespace grpc |
-} // namespace blink |
+int main(int argc, char** argv) { |
+ grpc::testing::InitBenchmark(&argc, &argv, true); |
-#endif |
+ grpc::testing::RunAsyncUnaryPingPong(); |
+ return 0; |
+} |