本文整理汇总了C++中GeolocationClientMock类的典型用法代码示例。如果您正苦于以下问题:C++ GeolocationClientMock类的具体用法?C++ GeolocationClientMock怎么用?C++ GeolocationClientMock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GeolocationClientMock类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ENABLE
void DumpRenderTreeSupportQt::resetGeolocationMock(QWebPage* page)
{
#if ENABLE(GEOLOCATION)
Page* corePage = QWebPagePrivate::core(page);
GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client());
mockClient->reset();
#endif
}
示例2: ENABLE
void DumpRenderTreeSupportQt::setMockGeolocationPositionUnavailableError(QWebPageAdapter* adapter, const QString& message)
{
#if ENABLE(GEOLOCATION)
Page* corePage = adapter->page;
GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(GeolocationController::from(corePage)->client());
mockClient->setPositionUnavailableError(message);
#endif
}
示例3: switch
void DumpRenderTreeSupport::setMockGeolocationError(WebPage* webPage, int errorCode, const String message)
{
GeolocationError::ErrorCode code = GeolocationError::PositionUnavailable;
switch (errorCode) {
case PositionError::PERMISSION_DENIED:
code = GeolocationError::PermissionDenied;
break;
case PositionError::POSITION_UNAVAILABLE:
code = GeolocationError::PositionUnavailable;
break;
}
GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(GeolocationController::from(corePage(webPage))->client());
mockClient->setError(GeolocationError::create(code, message));
}
示例4: toGeolocationClientMock
void DumpRenderTreeSupport::setMockGeolocationPosition(WebPage* webPage, double latitude, double longitude, double accuracy)
{
GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client());
mockClient->setPosition(GeolocationPosition::create(currentTime(), latitude, longitude, accuracy));
}