| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/callback_list.h" | 5 #include "base/callback_list.h" |
| 6 #include "base/lazy_instance.h" | 6 #include "base/lazy_instance.h" |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "content/public/browser/content_browser_client.h" | 8 #include "content/public/browser/content_browser_client.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 class TestContentBrowserClient : public ContentBrowserClient { | 89 class TestContentBrowserClient : public ContentBrowserClient { |
| 90 public: | 90 public: |
| 91 void OverrideRenderProcessMojoServices(ServiceRegistry* registry) override { | 91 void OverrideRenderProcessMojoServices(ServiceRegistry* registry) override { |
| 92 registry->AddService(base::Bind(&FakeBatteryMonitor::Create)); | 92 registry->AddService(base::Bind(&FakeBatteryMonitor::Create)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 #if defined(OS_ANDROID) | 95 #if defined(OS_ANDROID) |
| 96 void GetAdditionalMappedFilesForChildProcess( | 96 void GetAdditionalMappedFilesForChildProcess( |
| 97 const base::CommandLine& command_line, | 97 const base::CommandLine& command_line, |
| 98 int child_process_id, | 98 int child_process_id, |
| 99 FileDescriptorInfo* mappings) override { | 99 FileDescriptorInfo* mappings, |
| 100 std::map<int, base::MemoryMappedFile::Region>* regions) override { |
| 100 ShellContentBrowserClient::Get()->GetAdditionalMappedFilesForChildProcess( | 101 ShellContentBrowserClient::Get()->GetAdditionalMappedFilesForChildProcess( |
| 101 command_line, child_process_id, mappings); | 102 command_line, child_process_id, mappings, regions); |
| 102 } | 103 } |
| 103 #endif // defined(OS_ANDROID) | 104 #endif // defined(OS_ANDROID) |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 class BatteryMonitorIntegrationTest : public ContentBrowserTest { | 107 class BatteryMonitorIntegrationTest : public ContentBrowserTest { |
| 107 public: | 108 public: |
| 108 BatteryMonitorIntegrationTest() {} | 109 BatteryMonitorIntegrationTest() {} |
| 109 | 110 |
| 110 void SetUpOnMainThread() override { | 111 void SetUpOnMainThread() override { |
| 111 old_client_ = SetBrowserClientForTesting(&test_client_); | 112 old_client_ = SetBrowserClientForTesting(&test_client_); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 TestNavigationObserver same_tab_observer2(shell()->web_contents(), 1); | 169 TestNavigationObserver same_tab_observer2(shell()->web_contents(), 1); |
| 169 status.level = 0.6; | 170 status.level = 0.6; |
| 170 UpdateBattery(status); | 171 UpdateBattery(status); |
| 171 same_tab_observer2.Wait(); | 172 same_tab_observer2.Wait(); |
| 172 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); | 173 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); |
| 173 } | 174 } |
| 174 | 175 |
| 175 } // namespace | 176 } // namespace |
| 176 | 177 |
| 177 } // namespace content | 178 } // namespace content |
| OLD | NEW |