Chromium Code Reviews| Index: content/test/test_content_client.cc |
| diff --git a/content/test/test_content_client.cc b/content/test/test_content_client.cc |
| index 0ccc8cf5838c07d5861a0d8ff39181ee71571b18..70927fc3d872617e10f4549d55cf3edcaaad027f 100644 |
| --- a/content/test/test_content_client.cc |
| +++ b/content/test/test_content_client.cc |
| @@ -10,6 +10,10 @@ |
| #include "base/path_service.h" |
| #include "base/strings/string_piece.h" |
| +#if defined(OS_ANDROID) |
| +#include "base/android/apk_assets.h" |
| +#endif |
| + |
| namespace content { |
| TestContentClient::TestContentClient() |
| @@ -18,6 +22,14 @@ TestContentClient::TestContentClient() |
| #if !defined(OS_IOS) |
| base::FilePath content_shell_pack_path; |
| #if defined(OS_ANDROID) |
| + base::MemoryMappedFile::Region region; |
| + // Tests that don't yet use .isolate files require loading from within .apk. |
| + int fd = base::android::OpenApkAsset("assets/content_shell.pak", ®ion); |
| + if (fd >= 0) { |
| + data_pack_.LoadFromFileRegion(base::File(fd), region); |
| + return; |
|
boliu
2015/06/29 20:24:32
This is making the structure here super brittle. E
agrieve
2015/06/29 20:38:04
Agree. Will address in a follow-up.
|
| + } |
| + |
| // on Android all pak files are inside the paks folder. |
| PathService::Get(base::DIR_ANDROID_APP_DATA, &content_shell_pack_path); |
| content_shell_pack_path = content_shell_pack_path.Append( |