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.
5 #ifndef IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_FILE_BASED_RESPONSE_PROVIDER_IMPL_H_
6 #define IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_FILE_BASED_RESPONSE_PROVIDER_IMPL_H_
8 #include "base/files/file_path.h"
9 #include "ios/web/public/test/response_providers/response_provider.h"
15 // FileBasedMockResponseProvider tries to resolve URL as if it were a path
16 // relative to |path| on the filesystem. Use |BuildTargetPath| to resolve URLs
17 // to paths on the filesystem.
18 class FileBasedResponseProviderImpl
{
20 explicit FileBasedResponseProviderImpl(const base::FilePath
& path
);
21 virtual ~FileBasedResponseProviderImpl();
23 // Returns true if the request's URL when converted to a path on the app
24 // bundle has a file present.
25 bool CanHandleRequest(const ResponseProvider::Request
& request
);
26 // Converts |url| to a path on the app bundle. Used to resolve URLs on to the
28 base::FilePath
BuildTargetPath(const GURL
& url
);
31 // The path according to which URLs are resolved from.
36 #endif // IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_FILE_BASED_RESPONSE_PROVIDER_IMPL_H_