| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/chrome_browser_main.h" | 9 #include "chrome/browser/chrome_browser_main.h" |
| 10 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 10 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete()); | 436 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete()); |
| 437 delete test_server_; // Destructor wants UI thread. | 437 delete test_server_; // Destructor wants UI thread. |
| 438 } | 438 } |
| 439 | 439 |
| 440 scoped_ptr<HttpResponse> HandleRequest(const HttpRequest& request) { | 440 scoped_ptr<HttpResponse> HandleRequest(const HttpRequest& request) { |
| 441 GURL url = test_server_->GetURL(request.relative_url); | 441 GURL url = test_server_->GetURL(request.relative_url); |
| 442 LOG(INFO) << "Http request: " << url.spec(); | 442 LOG(INFO) << "Http request: " << url.spec(); |
| 443 | 443 |
| 444 scoped_ptr<BasicHttpResponse> http_response(new BasicHttpResponse()); | 444 scoped_ptr<BasicHttpResponse> http_response(new BasicHttpResponse()); |
| 445 if (url.path() == "/ServiceLogin") { | 445 if (url.path() == "/ServiceLogin") { |
| 446 http_response->set_code(net::test_server::SUCCESS); | 446 http_response->set_code(net::HTTP_OK); |
| 447 http_response->set_content(service_login_response_); | 447 http_response->set_content(service_login_response_); |
| 448 http_response->set_content_type("text/html"); | 448 http_response->set_content_type("text/html"); |
| 449 } else if (url.path() == "/ServiceLoginAuth") { | 449 } else if (url.path() == "/ServiceLoginAuth") { |
| 450 LOG(INFO) << "Params: " << request.content; | 450 LOG(INFO) << "Params: " << request.content; |
| 451 static const char kContinueParam[] = "continue="; | 451 static const char kContinueParam[] = "continue="; |
| 452 int continue_arg_begin = request.content.find(kContinueParam) + | 452 int continue_arg_begin = request.content.find(kContinueParam) + |
| 453 arraysize(kContinueParam) - 1; | 453 arraysize(kContinueParam) - 1; |
| 454 int continue_arg_end = request.content.find("&", continue_arg_begin); | 454 int continue_arg_end = request.content.find("&", continue_arg_begin); |
| 455 const std::string continue_url = request.content.substr( | 455 const std::string continue_url = request.content.substr( |
| 456 continue_arg_begin, continue_arg_end - continue_arg_begin); | 456 continue_arg_begin, continue_arg_end - continue_arg_begin); |
| 457 http_response->set_code(net::test_server::SUCCESS); | 457 http_response->set_code(net::HTTP_OK); |
| 458 const std::string redirect_js = | 458 const std::string redirect_js = |
| 459 "document.location.href = unescape('" + continue_url + "');"; | 459 "document.location.href = unescape('" + continue_url + "');"; |
| 460 http_response->set_content( | 460 http_response->set_content( |
| 461 "<HTML><HEAD><SCRIPT>\n" + redirect_js + "\n</SCRIPT></HEAD></HTML>"); | 461 "<HTML><HEAD><SCRIPT>\n" + redirect_js + "\n</SCRIPT></HEAD></HTML>"); |
| 462 http_response->set_content_type("text/html"); | 462 http_response->set_content_type("text/html"); |
| 463 } else { | 463 } else { |
| 464 LOG(ERROR) << "Unsupported url: " << url.path(); | 464 LOG(ERROR) << "Unsupported url: " << url.path(); |
| 465 } | 465 } |
| 466 return http_response.PassAs<HttpResponse>(); | 466 return http_response.PassAs<HttpResponse>(); |
| 467 } | 467 } |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 | 847 |
| 848 INSTANTIATE_TEST_CASE_P(KioskEnableCancelTestInstantiation, | 848 INSTANTIATE_TEST_CASE_P(KioskEnableCancelTestInstantiation, |
| 849 KioskEnableCancelTest, | 849 KioskEnableCancelTest, |
| 850 testing::Bool()); | 850 testing::Bool()); |
| 851 | 851 |
| 852 INSTANTIATE_TEST_CASE_P(KioskEnableConfirmedTestInstantiation, | 852 INSTANTIATE_TEST_CASE_P(KioskEnableConfirmedTestInstantiation, |
| 853 KioskEnableConfirmedTest, | 853 KioskEnableConfirmedTest, |
| 854 testing::Bool()); | 854 testing::Bool()); |
| 855 | 855 |
| 856 } // namespace chromeos | 856 } // namespace chromeos |
| OLD | NEW |