OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/test/chromedriver/server/http_handler.h" | 5 #include "chrome/test/chromedriver/server/http_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 base::Bind(&ExecuteIsAutoReporting))), | 605 base::Bind(&ExecuteIsAutoReporting))), |
606 CommandMapping(kPost, | 606 CommandMapping(kPost, |
607 "session/:sessionId/autoreport", | 607 "session/:sessionId/autoreport", |
608 WrapToCommand( | 608 WrapToCommand( |
609 "SetAutoReporting", | 609 "SetAutoReporting", |
610 base::Bind(&ExecuteSetAutoReporting))), | 610 base::Bind(&ExecuteSetAutoReporting))), |
611 CommandMapping(kPost, | 611 CommandMapping(kPost, |
612 "session/:sessionId/touch/pinch", | 612 "session/:sessionId/touch/pinch", |
613 WrapToCommand("TouchPinch", | 613 WrapToCommand("TouchPinch", |
614 base::Bind(&ExecuteTouchPinch))), | 614 base::Bind(&ExecuteTouchPinch))), |
| 615 CommandMapping(kPost, |
| 616 "session/:sessionId/chromium/send_command", |
| 617 WrapToCommand("SendCommand", |
| 618 base::Bind(&ExecuteSendCommand))), |
| 619 CommandMapping( |
| 620 kPost, |
| 621 "session/:sessionId/chromium/send_command_and_get_result", |
| 622 WrapToCommand("SendCommandAndGetResult", |
| 623 base::Bind(&ExecuteSendCommandAndGetResult))), |
615 }; | 624 }; |
616 command_map_.reset( | 625 command_map_.reset( |
617 new CommandMap(commands, commands + arraysize(commands))); | 626 new CommandMap(commands, commands + arraysize(commands))); |
618 } | 627 } |
619 | 628 |
620 HttpHandler::~HttpHandler() {} | 629 HttpHandler::~HttpHandler() {} |
621 | 630 |
622 void HttpHandler::Handle(const net::HttpServerRequestInfo& request, | 631 void HttpHandler::Handle(const net::HttpServerRequestInfo& request, |
623 const HttpResponseSenderFunc& send_response_func) { | 632 const HttpResponseSenderFunc& send_response_func) { |
624 CHECK(thread_checker_.CalledOnValidThread()); | 633 CHECK(thread_checker_.CalledOnValidThread()); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 params.SetString(name, decoded); | 913 params.SetString(name, decoded); |
905 } else if (command_path_parts[i] != path_parts[i]) { | 914 } else if (command_path_parts[i] != path_parts[i]) { |
906 return false; | 915 return false; |
907 } | 916 } |
908 } | 917 } |
909 out_params->MergeDictionary(¶ms); | 918 out_params->MergeDictionary(¶ms); |
910 return true; | 919 return true; |
911 } | 920 } |
912 | 921 |
913 } // namespace internal | 922 } // namespace internal |
OLD | NEW |