Chromium Code Reviews| Index: content/browser/battery_status/battery_monitor_integration_browsertest.cc |
| diff --git a/content/browser/battery_status/battery_monitor_integration_browsertest.cc b/content/browser/battery_status/battery_monitor_integration_browsertest.cc |
| index 7b60ff60a2a8092b52a839bcce10e5ef40bb0589..132fee620689141dde90006a04adb8cb0dc6d994 100644 |
| --- a/content/browser/battery_status/battery_monitor_integration_browsertest.cc |
| +++ b/content/browser/battery_status/battery_monitor_integration_browsertest.cc |
| @@ -4,6 +4,7 @@ |
| #include "base/callback_list.h" |
| #include "base/lazy_instance.h" |
| +#include "base/path_service.h" |
| #include "base/thread_task_runner_handle.h" |
| #include "content/public/browser/content_browser_client.h" |
| #include "content/public/browser/web_contents.h" |
| @@ -13,6 +14,9 @@ |
| #include "content/public/test/content_browser_test_utils.h" |
| #include "content/public/test/test_navigation_observer.h" |
| #include "content/public/test/test_utils.h" |
| +#if defined(OS_ANDROID) |
|
ppi
2015/01/21 00:33:50
Jochen will correct me if I'm wrong, but I thing w
|
| +#include "content/shell/android/shell_descriptors.h" |
| +#endif |
| #include "content/shell/browser/shell.h" |
| #include "content/shell/browser/shell_content_browser_client.h" |
| #include "device/battery/battery_monitor.mojom.h" |
| @@ -91,6 +95,28 @@ class TestContentBrowserClient : public ContentBrowserClient { |
| void OverrideRenderProcessMojoServices(ServiceRegistry* registry) override { |
| registry->AddService(base::Bind(&FakeBatteryMonitor::Create)); |
| } |
| +#if defined(OS_ANDROID) |
| + void GetAdditionalMappedFilesForChildProcess( |
|
ppi
2015/01/21 00:33:50
We shouldn't duplicate the code from ShellContentB
|
| + const base::CommandLine& command_line, |
| + int child_process_id, |
| + FileDescriptorInfo* mappings) override { |
| + int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; |
| + base::FilePath pak_file; |
| + bool r = PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file); |
| + CHECK(r); |
| + pak_file = pak_file.Append(FILE_PATH_LITERAL("paks")); |
| + pak_file = pak_file.Append(FILE_PATH_LITERAL("content_shell.pak")); |
| + |
| + base::File f(pak_file, flags); |
| + if (!f.IsValid()) { |
| + NOTREACHED() << "Failed to open file when creating renderer process: " |
| + << "content_shell.pak"; |
| + } |
| + |
| + mappings->Transfer(kShellPakDescriptor, |
| + base::ScopedFD(f.TakePlatformFile())); |
| + } |
| +#endif // defined(OS_ANDROID) |
| }; |
| class BatteryMonitorIntegrationTest : public ContentBrowserTest { |