| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
| 7 #include "base/test/perf_time_logger.h" | 7 #include "base/test/perf_time_logger.h" |
| 8 #include "ppapi/c/ppp_messaging.h" | 8 #include "ppapi/c/ppp_messaging.h" |
| 9 #include "ppapi/proxy/ppapi_messages.h" | 9 #include "ppapi/proxy/ppapi_messages.h" |
| 10 #include "ppapi/proxy/ppapi_proxy_test.h" | 10 #include "ppapi/proxy/ppapi_proxy_test.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 // Tests the performance of sending strings through the proxy. | 53 // Tests the performance of sending strings through the proxy. |
| 54 TEST_F(PppMessagingPerfTest, StringPerformance) { | 54 TEST_F(PppMessagingPerfTest, StringPerformance) { |
| 55 const PP_Instance kTestInstance = pp_instance(); | 55 const PP_Instance kTestInstance = pp_instance(); |
| 56 int seed = 123; | 56 int seed = 123; |
| 57 int string_count = 1000; | 57 int string_count = 1000; |
| 58 int max_string_size = 1000000; | 58 int max_string_size = 1000000; |
| 59 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 59 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 60 if (command_line) { | 60 if (command_line) { |
| 61 if (command_line->HasSwitch("seed")) { | 61 if (command_line->HasSwitch("seed")) { |
| 62 base::StringToInt(command_line->GetSwitchValueASCII("seed"), | 62 base::StringToInt(command_line->GetSwitchValueASCII("seed"), |
| 63 &seed); | 63 &seed); |
| 64 } | 64 } |
| 65 if (command_line->HasSwitch("string_count")) { | 65 if (command_line->HasSwitch("string_count")) { |
| 66 base::StringToInt(command_line->GetSwitchValueASCII("string_count"), | 66 base::StringToInt(command_line->GetSwitchValueASCII("string_count"), |
| 67 &string_count); | 67 &string_count); |
| 68 } | 68 } |
| 69 if (command_line->HasSwitch("max_string_size")) { | 69 if (command_line->HasSwitch("max_string_size")) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 84 ppapi::proxy::SerializedVarSendInput(host().host_dispatcher(), | 84 ppapi::proxy::SerializedVarSendInput(host().host_dispatcher(), |
| 85 host_string))); | 85 host_string))); |
| 86 handle_message_called.Wait(); | 86 handle_message_called.Wait(); |
| 87 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(host_string); | 87 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(host_string); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace proxy | 91 } // namespace proxy |
| 92 } // namespace ppapi | 92 } // namespace ppapi |
| 93 | 93 |
| OLD | NEW |