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

Side by Side Diff: ios/web/public/test/response_providers/file_based_response_provider.mm

Issue 2898733003: Split up ios/web:test_support. (Closed)
Patch Set: don't break downstream clients Created 3 years, 6 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "ios/web/public/test/response_providers/file_based_response_provider.h"
6
7 #include "base/files/file_path.h"
8 #include "base/strings/sys_string_conversions.h"
9 #import "ios/third_party/gcdwebserver/src/GCDWebServer/Responses/GCDWebServerFil eResponse.h"
10
11 namespace web {
12
13 FileBasedResponseProvider::FileBasedResponseProvider(const base::FilePath& path)
14 : response_provider_impl_(new FileBasedResponseProviderImpl(path)) {
15 }
16
17 FileBasedResponseProvider::~FileBasedResponseProvider() {
18 }
19
20 bool FileBasedResponseProvider::CanHandleRequest(const Request& request) {
21 return response_provider_impl_->CanHandleRequest(request);
22 }
23
24 GCDWebServerResponse* FileBasedResponseProvider::GetGCDWebServerResponse(
25 const Request& request) {
26 const base::FilePath file_path =
27 response_provider_impl_->BuildTargetPath(request.url);
28 NSString* path = base::SysUTF8ToNSString(file_path.value());
29 return [GCDWebServerFileResponse responseWithFile:path];
30 }
31
32 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698