Index: third_party/grpc/test/cpp/qps/secure_sync_unary_ping_pong_test.cc |
diff --git a/third_party/WebKit/Source/core/page/PagePopupController.h b/third_party/grpc/test/cpp/qps/secure_sync_unary_ping_pong_test.cc |
similarity index 53% |
copy from third_party/WebKit/Source/core/page/PagePopupController.h |
copy to third_party/grpc/test/cpp/qps/secure_sync_unary_ping_pong_test.cc |
index 4886579802ac159d284c38962c0af185ec5cd5be..359310b85606198725f8988e717409129ad41742 100644 |
--- a/third_party/WebKit/Source/core/page/PagePopupController.h |
+++ b/third_party/grpc/test/cpp/qps/secure_sync_unary_ping_pong_test.cc |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (C) 2012 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,45 +28,57 @@ |
* 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 PagePopupController_h |
-#define PagePopupController_h |
+#include <set> |
+ |
+#include <grpc/support/log.h> |
+ |
+#include "test/cpp/qps/driver.h" |
+#include "test/cpp/qps/report.h" |
+#include "test/cpp/util/benchmark_config.h" |
+ |
+namespace grpc { |
+namespace testing { |
+ |
+static const int WARMUP = 5; |
+static const int BENCHMARK = 10; |
+ |
+static void RunSynchronousUnaryPingPong() { |
+ gpr_log(GPR_INFO, "Running Synchronous Unary Ping Pong"); |
-#include "bindings/core/v8/ScriptWrappable.h" |
-#include "platform/heap/Handle.h" |
-#include "wtf/Forward.h" |
+ ClientConfig client_config; |
+ client_config.set_client_type(SYNC_CLIENT); |
+ client_config.set_outstanding_rpcs_per_channel(1); |
+ client_config.set_client_channels(1); |
+ client_config.set_rpc_type(UNARY); |
+ client_config.mutable_load_params()->mutable_closed_loop(); |
-namespace blink { |
+ ServerConfig server_config; |
+ server_config.set_server_type(SYNC_SERVER); |
-class Document; |
-class PagePopup; |
-class PagePopupClient; |
+ // Set up security params |
+ SecurityParams security; |
+ security.set_use_test_ca(true); |
+ security.set_server_host_override("foo.test.google.fr"); |
+ client_config.mutable_security_params()->CopyFrom(security); |
+ server_config.mutable_security_params()->CopyFrom(security); |
-class PagePopupController final : public GarbageCollected<PagePopupController>, public ScriptWrappable { |
- DEFINE_WRAPPERTYPEINFO(); |
-public: |
- static PagePopupController* create(PagePopup&, PagePopupClient*); |
- void setValueAndClosePopup(int numValue, const String& stringValue); |
- void setValue(const String&); |
- void closePopup(); |
- void selectFontsFromOwnerDocument(Document* targetDocument); |
- String localizeNumberString(const String&); |
- String formatMonth(int year, int zeroBaseMonth); |
- String formatShortMonth(int year, int zeroBaseMonth); |
- String formatWeek(int year, int weekNumber, const String& localizedStartDate); |
- void clearPagePopupClient(); |
- void setWindowRect(int x, int y, int width, int height); |
+ const auto result = |
+ RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2); |
- DEFINE_INLINE_TRACE() { } |
+ GetReporter()->ReportQPS(*result); |
+ GetReporter()->ReportLatency(*result); |
+} |
-private: |
- PagePopupController(PagePopup&, PagePopupClient*); |
+} // namespace testing |
+} // namespace grpc |
- PagePopup& m_popup; |
- PagePopupClient* m_popupClient; |
-}; |
+int main(int argc, char** argv) { |
+ grpc::testing::InitBenchmark(&argc, &argv, true); |
-} // namespace blink |
+ grpc::testing::RunSynchronousUnaryPingPong(); |
-#endif // PagePopupController_h |
+ return 0; |
+} |