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

Side by Side Diff: content/browser/battery_status/battery_monitor_integration_browsertest.cc

Issue 845673004: Add BatteryMonitorIntegrationBrowsertest::GetAdditionalMappedFilesForChildProcess for returning req… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 BatteryStatusCallback callback_; 84 BatteryStatusCallback callback_;
85 }; 85 };
86 86
87 // Overrides the default service implementation with the test implementation 87 // Overrides the default service implementation with the test implementation
88 // declared above. 88 // declared above.
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
95 #if defined(OS_ANDROID)
96 void GetAdditionalMappedFilesForChildProcess(
97 const base::CommandLine& command_line,
98 int child_process_id,
99 FileDescriptorInfo* mappings) override {
100 ShellContentBrowserClient::Get()->GetAdditionalMappedFilesForChildProcess(
101 command_line, child_process_id, mappings);
102 }
103 #endif // defined(OS_ANDROID)
94 }; 104 };
95 105
96 class BatteryMonitorIntegrationTest : public ContentBrowserTest { 106 class BatteryMonitorIntegrationTest : public ContentBrowserTest {
97 public: 107 public:
98 BatteryMonitorIntegrationTest() {} 108 BatteryMonitorIntegrationTest() {}
99 109
100 void SetUpOnMainThread() override { 110 void SetUpOnMainThread() override {
101 old_client_ = SetBrowserClientForTesting(&test_client_); 111 old_client_ = SetBrowserClientForTesting(&test_client_);
102 } 112 }
103 113
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 TestNavigationObserver same_tab_observer2(shell()->web_contents(), 1); 168 TestNavigationObserver same_tab_observer2(shell()->web_contents(), 1);
159 status.level = 0.6; 169 status.level = 0.6;
160 UpdateBattery(status); 170 UpdateBattery(status);
161 same_tab_observer2.Wait(); 171 same_tab_observer2.Wait();
162 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); 172 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref());
163 } 173 }
164 174
165 } // namespace 175 } // namespace
166 176
167 } // namespace content 177 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698