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

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 1844033004: Revert of Change the battery-status layout tests to use JS mocks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | content/shell/renderer/layout_test/blink_test_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/renderer_blink_platform_impl.h" 5 #include "content/renderer/renderer_blink_platform_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 blink::WebPlatformEventType type, 1159 blink::WebPlatformEventType type,
1160 scoped_ptr<PlatformEventObserverBase> observer) { 1160 scoped_ptr<PlatformEventObserverBase> observer) {
1161 if (platform_event_observers_.Lookup(type)) 1161 if (platform_event_observers_.Lookup(type))
1162 platform_event_observers_.Remove(type); 1162 platform_event_observers_.Remove(type);
1163 platform_event_observers_.AddWithID(observer.release(), type); 1163 platform_event_observers_.AddWithID(observer.release(), type);
1164 } 1164 }
1165 1165
1166 void RendererBlinkPlatformImpl::connectToRemoteService( 1166 void RendererBlinkPlatformImpl::connectToRemoteService(
1167 const char* name, 1167 const char* name,
1168 mojo::ScopedMessagePipeHandle handle) { 1168 mojo::ScopedMessagePipeHandle handle) {
1169 // In the layout test mode, mock services should be used instead.
1170 // TODO(yukishiino): We'd like to inject mock services implemented in
1171 // JavaScript. Remove the following hack once we support JS-bindings
1172 // of Mojo and service mocking in JS.
1173 if (RenderThreadImpl::current() &&
1174 RenderThreadImpl::current()->layout_test_mode())
1175 return;
1176
1169 RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService( 1177 RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService(
1170 name, std::move(handle)); 1178 name, std::move(handle));
1171 } 1179 }
1172 1180
1173 void RendererBlinkPlatformImpl::startListening( 1181 void RendererBlinkPlatformImpl::startListening(
1174 blink::WebPlatformEventType type, 1182 blink::WebPlatformEventType type,
1175 blink::WebPlatformEventListener* listener) { 1183 blink::WebPlatformEventListener* listener) {
1176 PlatformEventObserverBase* observer = platform_event_observers_.Lookup(type); 1184 PlatformEventObserverBase* observer = platform_event_observers_.Lookup(type);
1177 if (!observer) { 1185 if (!observer) {
1178 observer = CreatePlatformEventObserverFromType(type); 1186 observer = CreatePlatformEventObserverFromType(type);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 } 1263 }
1256 1264
1257 //------------------------------------------------------------------------------ 1265 //------------------------------------------------------------------------------
1258 1266
1259 blink::WebTrialTokenValidator* 1267 blink::WebTrialTokenValidator*
1260 RendererBlinkPlatformImpl::trialTokenValidator() { 1268 RendererBlinkPlatformImpl::trialTokenValidator() {
1261 return &trial_token_validator_; 1269 return &trial_token_validator_;
1262 } 1270 }
1263 1271
1264 } // namespace content 1272 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/shell/renderer/layout_test/blink_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698