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

Side by Side Diff: content/test/layouttest_support.cc

Issue 701953007: Expose mock geofencing service via testRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mention unifying bug in a comment Created 6 years 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 | « content/shell/renderer/test_runner/web_test_delegate.h ('k') | 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 (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/public/test/layouttest_support.h" 5 #include "content/public/test/layouttest_support.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "cc/blink/web_layer_impl.h" 9 #include "cc/blink/web_layer_impl.h"
10 #include "content/browser/renderer_host/render_widget_host_impl.h" 10 #include "content/browser/renderer_host/render_widget_host_impl.h"
11 #include "content/child/bluetooth/web_bluetooth_impl.h" 11 #include "content/child/bluetooth/web_bluetooth_impl.h"
12 #include "content/child/geofencing/web_geofencing_provider_impl.h"
12 #include "content/common/gpu/image_transport_surface.h" 13 #include "content/common/gpu/image_transport_surface.h"
13 #include "content/public/common/page_state.h" 14 #include "content/public/common/page_state.h"
14 #include "content/public/renderer/renderer_gamepad_provider.h" 15 #include "content/public/renderer/renderer_gamepad_provider.h"
15 #include "content/renderer/fetchers/manifest_fetcher.h" 16 #include "content/renderer/fetchers/manifest_fetcher.h"
16 #include "content/renderer/history_entry.h" 17 #include "content/renderer/history_entry.h"
17 #include "content/renderer/history_serialization.h" 18 #include "content/renderer/history_serialization.h"
18 #include "content/renderer/render_frame_impl.h" 19 #include "content/renderer/render_frame_impl.h"
19 #include "content/renderer/render_thread_impl.h" 20 #include "content/renderer/render_thread_impl.h"
20 #include "content/renderer/render_view_impl.h" 21 #include "content/renderer/render_view_impl.h"
21 #include "content/renderer/renderer_blink_platform_impl.h" 22 #include "content/renderer/renderer_blink_platform_impl.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 SetDeviceColorProfileForTesting(color_profile); 312 SetDeviceColorProfileForTesting(color_profile);
312 } 313 }
313 314
314 void SetBluetoothMockDataSetForTesting(const std::string& name) { 315 void SetBluetoothMockDataSetForTesting(const std::string& name) {
315 RenderThreadImpl::current() 316 RenderThreadImpl::current()
316 ->blink_platform_impl() 317 ->blink_platform_impl()
317 ->BluetoothImplForTesting() 318 ->BluetoothImplForTesting()
318 ->SetBluetoothMockDataSetForTesting(name); 319 ->SetBluetoothMockDataSetForTesting(name);
319 } 320 }
320 321
322 void SetGeofencingMockProvider(bool service_available) {
323 static_cast<WebGeofencingProviderImpl*>(
324 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider())
325 ->SetMockProvider(service_available);
326 }
327
328 void ClearGeofencingMockProvider() {
329 static_cast<WebGeofencingProviderImpl*>(
330 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider())
331 ->ClearMockProvider();
332 }
333
334 void SetGeofencingMockPosition(double latitude, double longitude) {
335 static_cast<WebGeofencingProviderImpl*>(
336 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider())
337 ->SetMockPosition(latitude, longitude);
338 }
339
321 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { 340 void UseSynchronousResizeMode(RenderView* render_view, bool enable) {
322 static_cast<RenderViewImpl*>(render_view)-> 341 static_cast<RenderViewImpl*>(render_view)->
323 UseSynchronousResizeModeForTesting(enable); 342 UseSynchronousResizeModeForTesting(enable);
324 } 343 }
325 344
326 void EnableAutoResizeMode(RenderView* render_view, 345 void EnableAutoResizeMode(RenderView* render_view,
327 const WebSize& min_size, 346 const WebSize& min_size,
328 const WebSize& max_size) { 347 const WebSize& max_size) {
329 static_cast<RenderViewImpl*>(render_view)-> 348 static_cast<RenderViewImpl*>(render_view)->
330 EnableAutoResizeForTesting(min_size, max_size); 349 EnableAutoResizeForTesting(min_size, max_size);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 } 414 }
396 result.append("===============================================\n"); 415 result.append("===============================================\n");
397 return result; 416 return result;
398 } 417 }
399 418
400 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { 419 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) {
401 return new cc_blink::WebLayerImpl(layer); 420 return new cc_blink::WebLayerImpl(layer);
402 } 421 }
403 422
404 } // namespace content 423 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/web_test_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698