| 681 | } |
| 682 | |
| 683 | std::string Server::LookupCommand(const std::string& uri, |
| 684 | const std::string& http_verb, |
| 685 | std::string* session_id, |
| 686 | std::string* locator) { |
| 687 | LOG(TRACE) << "Entering Server::LookupCommand"; |
| 688 | |
| 689 | std::string value = webdriver::CommandType::NoCommand; |
| 690 | std::vector<std::string> url_fragments; |
| 691 | UriInfo::ParseUri(uri, &url_fragments, NULL); |
| 692 | UrlMap::const_iterator it = this->commands_.begin(); |
| 693 | for (; it != this->commands_.end(); ++it) { |
| 694 | std::vector<std::string> locator_param_names; |
| 695 | std::vector<std::string> locator_param_values; |
| 696 | if (it->second->IsUriMatch(url_fragments, |
| 697 | &locator_param_names, |
| 698 | &locator_param_values)) { |
| 699 | if (it->second->HasHttpVerb(http_verb, &value)) { |
| 700 | std::string param = this->ConstructLocatorParameterJson( |
| 701 | locator_param_names, locator_param_values, session_id); |
| 702 | locator->append(param); |
| 703 | } else { |
| 704 | locator->append(it->second->GetSupportedVerbs()); |
| 705 | } |
| 706 | break; |
| 707 | } |
| 708 | } |
| 709 | return value; |
| 710 | } |
| 711 | |
| 712 | std::string Server::ConstructLocatorParameterJson( |
| 713 | std::vector<std::string> locator_param_names, |
no test coverage detected