Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(944)

Side by Side Diff: mojo/runner/shell_apptest.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/video/capture/win/video_capture_device_factory_win.cc ('k') | pdf/document_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 24 matching lines...) Expand all
35 : binding_(this, request.Pass()), port_(port) { 35 : binding_(this, request.Pass()), port_(port) {
36 } 36 }
37 ~GetHandler() override {} 37 ~GetHandler() override {}
38 38
39 private: 39 private:
40 // http_server::HttpHandler: 40 // http_server::HttpHandler:
41 void HandleRequest( 41 void HandleRequest(
42 http_server::HttpRequestPtr request, 42 http_server::HttpRequestPtr request,
43 const Callback<void(http_server::HttpResponsePtr)>& callback) override { 43 const Callback<void(http_server::HttpResponsePtr)>& callback) override {
44 http_server::HttpResponsePtr response; 44 http_server::HttpResponsePtr response;
45 if (base::StartsWithASCII(request->relative_url, "/app", true)) { 45 if (base::StartsWith(request->relative_url, "/app",
46 base::CompareCase::SENSITIVE)) {
46 response = http_server::CreateHttpResponse( 47 response = http_server::CreateHttpResponse(
47 200, std::string(kPingable.data, kPingable.size)); 48 200, std::string(kPingable.data, kPingable.size));
48 response->content_type = "application/octet-stream"; 49 response->content_type = "application/octet-stream";
49 } else if (request->relative_url == "/redirect") { 50 } else if (request->relative_url == "/redirect") {
50 response = http_server::HttpResponse::New(); 51 response = http_server::HttpResponse::New();
51 response->status_code = 302; 52 response->status_code = 302;
52 response->custom_headers.insert("Location", GetURL(port_, "app")); 53 response->custom_headers.insert("Location", GetURL(port_, "app"));
53 } else { 54 } else {
54 NOTREACHED(); 55 NOTREACHED();
55 } 56 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 EXPECT_EQ(app_url.To<std::string>() + "?foo", connection_url); 190 EXPECT_EQ(app_url.To<std::string>() + "?foo", connection_url);
190 EXPECT_EQ("hello", message); 191 EXPECT_EQ("hello", message);
191 base::MessageLoop::current()->Quit(); 192 base::MessageLoop::current()->Quit();
192 }; 193 };
193 pingable->Ping("hello", callback); 194 pingable->Ping("hello", callback);
194 base::RunLoop().Run(); 195 base::RunLoop().Run();
195 } 196 }
196 197
197 } // namespace 198 } // namespace
198 } // namespace mojo 199 } // namespace mojo
OLDNEW
« no previous file with comments | « media/video/capture/win/video_capture_device_factory_win.cc ('k') | pdf/document_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698