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

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

Issue 2060943005: Enable content embedder register mojo services with RPH-specific information. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 <utility> 5 #include <utility>
6 6
7 #include "base/callback_list.h" 7 #include "base/callback_list.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 std::unique_ptr<BatteryUpdateSubscription> subscription_; 85 std::unique_ptr<BatteryUpdateSubscription> subscription_;
86 mojo::StrongBinding<BatteryMonitor> binding_; 86 mojo::StrongBinding<BatteryMonitor> binding_;
87 BatteryStatusCallback callback_; 87 BatteryStatusCallback callback_;
88 }; 88 };
89 89
90 // Overrides the default service implementation with the test implementation 90 // Overrides the default service implementation with the test implementation
91 // declared above. 91 // declared above.
92 class TestContentBrowserClient : public ContentBrowserClient { 92 class TestContentBrowserClient : public ContentBrowserClient {
93 public: 93 public:
94 void RegisterRenderProcessMojoServices(ServiceRegistry* registry) override { 94 void RegisterRenderProcessMojoServices(
95 ServiceRegistry* registry,
96 RenderProcessHost* render_process_host) override {
95 registry->AddService(base::Bind(&FakeBatteryMonitor::Create)); 97 registry->AddService(base::Bind(&FakeBatteryMonitor::Create));
96 } 98 }
97 99
98 void AppendExtraCommandLineSwitches(base::CommandLine* command_line, 100 void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
99 int child_process_id) override { 101 int child_process_id) override {
100 // Necessary for passing kIsolateSitesForTesting flag to the renderer. 102 // Necessary for passing kIsolateSitesForTesting flag to the renderer.
101 ShellContentBrowserClient::Get()->AppendExtraCommandLineSwitches( 103 ShellContentBrowserClient::Get()->AppendExtraCommandLineSwitches(
102 command_line, child_process_id); 104 command_line, child_process_id);
103 } 105 }
104 106
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 TestNavigationObserver same_tab_observer2(shell()->web_contents(), 1); 181 TestNavigationObserver same_tab_observer2(shell()->web_contents(), 1);
180 status.level = 0.6; 182 status.level = 0.6;
181 UpdateBattery(status); 183 UpdateBattery(status);
182 same_tab_observer2.Wait(); 184 same_tab_observer2.Wait();
183 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); 185 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref());
184 } 186 }
185 187
186 } // namespace 188 } // namespace
187 189
188 } // namespace content 190 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698