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

Side by Side Diff: content/shell/renderer/test_runner/TestRunner.cpp

Issue 144023010: Remove unused geolocation code from TestRunner and WebTestProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 /* 5 /*
6 * Copyright (C) 2010 Google Inc. All rights reserved. 6 * Copyright (C) 2010 Google Inc. All rights reserved.
7 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) 7 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org)
8 * Copyright (C) 2012 Apple Inc. All Rights Reserved. 8 * Copyright (C) 2012 Apple Inc. All Rights Reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "third_party/WebKit/public/platform/WebDeviceMotionData.h" 50 #include "third_party/WebKit/public/platform/WebDeviceMotionData.h"
51 #include "third_party/WebKit/public/platform/WebDeviceOrientationData.h" 51 #include "third_party/WebKit/public/platform/WebDeviceOrientationData.h"
52 #include "third_party/WebKit/public/platform/WebPoint.h" 52 #include "third_party/WebKit/public/platform/WebPoint.h"
53 #include "third_party/WebKit/public/platform/WebURLResponse.h" 53 #include "third_party/WebKit/public/platform/WebURLResponse.h"
54 #include "third_party/WebKit/public/web/WebBindings.h" 54 #include "third_party/WebKit/public/web/WebBindings.h"
55 #include "third_party/WebKit/public/web/WebDataSource.h" 55 #include "third_party/WebKit/public/web/WebDataSource.h"
56 #include "third_party/WebKit/public/web/WebDocument.h" 56 #include "third_party/WebKit/public/web/WebDocument.h"
57 #include "third_party/WebKit/public/web/WebElement.h" 57 #include "third_party/WebKit/public/web/WebElement.h"
58 #include "third_party/WebKit/public/web/WebFindOptions.h" 58 #include "third_party/WebKit/public/web/WebFindOptions.h"
59 #include "third_party/WebKit/public/web/WebFrame.h" 59 #include "third_party/WebKit/public/web/WebFrame.h"
60 #include "third_party/WebKit/public/web/WebGeolocationClientMock.h"
61 #include "third_party/WebKit/public/web/WebInputElement.h" 60 #include "third_party/WebKit/public/web/WebInputElement.h"
62 #include "third_party/WebKit/public/web/WebMIDIClientMock.h" 61 #include "third_party/WebKit/public/web/WebMIDIClientMock.h"
63 #include "third_party/WebKit/public/web/WebScriptSource.h" 62 #include "third_party/WebKit/public/web/WebScriptSource.h"
64 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 63 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
65 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" 64 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h"
66 #include "third_party/WebKit/public/web/WebSettings.h" 65 #include "third_party/WebKit/public/web/WebSettings.h"
67 #include "third_party/WebKit/public/web/WebSurroundingText.h" 66 #include "third_party/WebKit/public/web/WebSurroundingText.h"
68 #include "third_party/WebKit/public/web/WebView.h" 67 #include "third_party/WebKit/public/web/WebView.h"
69 #include "v8/include/v8.h" 68 #include "v8/include/v8.h"
70 69
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 bindMethod("showWebInspector", &TestRunner::showWebInspector); 285 bindMethod("showWebInspector", &TestRunner::showWebInspector);
287 bindMethod("closeWebInspector", &TestRunner::closeWebInspector); 286 bindMethod("closeWebInspector", &TestRunner::closeWebInspector);
288 bindMethod("evaluateInWebInspector", &TestRunner::evaluateInWebInspector); 287 bindMethod("evaluateInWebInspector", &TestRunner::evaluateInWebInspector);
289 bindMethod("clearAllDatabases", &TestRunner::clearAllDatabases); 288 bindMethod("clearAllDatabases", &TestRunner::clearAllDatabases);
290 bindMethod("setDatabaseQuota", &TestRunner::setDatabaseQuota); 289 bindMethod("setDatabaseQuota", &TestRunner::setDatabaseQuota);
291 bindMethod("setAlwaysAcceptCookies", &TestRunner::setAlwaysAcceptCookies); 290 bindMethod("setAlwaysAcceptCookies", &TestRunner::setAlwaysAcceptCookies);
292 bindMethod("setWindowIsKey", &TestRunner::setWindowIsKey); 291 bindMethod("setWindowIsKey", &TestRunner::setWindowIsKey);
293 bindMethod("pathToLocalResource", &TestRunner::pathToLocalResource); 292 bindMethod("pathToLocalResource", &TestRunner::pathToLocalResource);
294 bindMethod("setBackingScaleFactor", &TestRunner::setBackingScaleFactor); 293 bindMethod("setBackingScaleFactor", &TestRunner::setBackingScaleFactor);
295 bindMethod("setPOSIXLocale", &TestRunner::setPOSIXLocale); 294 bindMethod("setPOSIXLocale", &TestRunner::setPOSIXLocale);
296 bindMethod("numberOfPendingGeolocationPermissionRequests", &TestRunner:: num berOfPendingGeolocationPermissionRequests);
297 bindMethod("setGeolocationPermission", &TestRunner::setGeolocationPermission );
298 bindMethod("setMockGeolocationPositionUnavailableError", &TestRunner::setMoc kGeolocationPositionUnavailableError);
299 bindMethod("setMockGeolocationPosition", &TestRunner::setMockGeolocationPosi tion);
300 bindMethod("setMIDIAccessorResult", &TestRunner::setMIDIAccessorResult); 295 bindMethod("setMIDIAccessorResult", &TestRunner::setMIDIAccessorResult);
301 bindMethod("setMIDISysExPermission", &TestRunner::setMIDISysExPermission); 296 bindMethod("setMIDISysExPermission", &TestRunner::setMIDISysExPermission);
302 bindMethod("grantWebNotificationPermission", &TestRunner::grantWebNotificati onPermission); 297 bindMethod("grantWebNotificationPermission", &TestRunner::grantWebNotificati onPermission);
303 bindMethod("simulateLegacyWebNotificationClick", &TestRunner::simulateLegacy WebNotificationClick); 298 bindMethod("simulateLegacyWebNotificationClick", &TestRunner::simulateLegacy WebNotificationClick);
304 bindMethod("cancelAllActiveNotifications", &TestRunner::cancelAllActiveNotif ications); 299 bindMethod("cancelAllActiveNotifications", &TestRunner::cancelAllActiveNotif ications);
305 bindMethod("addMockSpeechInputResult", &TestRunner::addMockSpeechInputResult ); 300 bindMethod("addMockSpeechInputResult", &TestRunner::addMockSpeechInputResult );
306 bindMethod("setMockSpeechInputDumpRect", &TestRunner::setMockSpeechInputDump Rect); 301 bindMethod("setMockSpeechInputDumpRect", &TestRunner::setMockSpeechInputDump Rect);
307 bindMethod("addMockSpeechRecognitionResult", &TestRunner::addMockSpeechRecog nitionResult); 302 bindMethod("addMockSpeechRecognitionResult", &TestRunner::addMockSpeechRecog nitionResult);
308 bindMethod("setMockSpeechRecognitionError", &TestRunner::setMockSpeechRecogn itionError); 303 bindMethod("setMockSpeechRecognitionError", &TestRunner::setMockSpeechRecogn itionError);
309 bindMethod("wasMockSpeechRecognitionAborted", &TestRunner::wasMockSpeechReco gnitionAborted); 304 bindMethod("wasMockSpeechRecognitionAborted", &TestRunner::wasMockSpeechReco gnitionAborted);
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 new InvokeCallbackTask(this, callbackArguments.Pass())); 1784 new InvokeCallbackTask(this, callbackArguments.Pass()));
1790 } 1785 }
1791 1786
1792 void TestRunner::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* re sult) 1787 void TestRunner::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* re sult)
1793 { 1788 {
1794 result->setNull(); 1789 result->setNull();
1795 if (arguments.size() == 1 && arguments[0].isString()) 1790 if (arguments.size() == 1 && arguments[0].isString())
1796 m_delegate->setLocale(arguments[0].toString()); 1791 m_delegate->setLocale(arguments[0].toString());
1797 } 1792 }
1798 1793
1799 void TestRunner::numberOfPendingGeolocationPermissionRequests(const CppArgumentL ist& arguments, CppVariant* result)
1800 {
1801 result->set(m_proxy->geolocationClientMock()->numberOfPendingPermissionReque sts());
1802 }
1803
1804 // FIXME: For greater test flexibility, we should be able to set each page's geo location mock individually.
1805 // https://bugs.webkit.org/show_bug.cgi?id=52368
1806 void TestRunner::setGeolocationPermission(const CppArgumentList& arguments, CppV ariant* result)
1807 {
1808 result->setNull();
1809 if (arguments.size() < 1 || !arguments[0].isBool())
1810 return;
1811 const vector<WebTestProxyBase*>& windowList = m_testInterfaces->windowList() ;
1812 for (unsigned i = 0; i < windowList.size(); ++i)
1813 windowList.at(i)->geolocationClientMock()->setPermission(arguments[0].to Boolean());
1814 }
1815
1816 void TestRunner::setMockGeolocationPosition(const CppArgumentList& arguments, Cp pVariant* result)
1817 {
1818 result->setNull();
1819 if (arguments.size() < 3 || !arguments[0].isNumber() || !arguments[1].isNumb er() || !arguments[2].isNumber())
1820 return;
1821 const vector<WebTestProxyBase*>& windowList = m_testInterfaces->windowList() ;
1822 for (unsigned i = 0; i < windowList.size(); ++i)
1823 windowList.at(i)->geolocationClientMock()->setPosition(arguments[0].toDo uble(), arguments[1].toDouble(), arguments[2].toDouble());
1824 }
1825
1826 void TestRunner::setMockGeolocationPositionUnavailableError(const CppArgumentLis t& arguments, CppVariant* result)
1827 {
1828 result->setNull();
1829 if (arguments.size() != 1 || !arguments[0].isString())
1830 return;
1831 const vector<WebTestProxyBase*>& windowList = m_testInterfaces->windowList() ;
1832 for (unsigned i = 0; i < windowList.size(); ++i)
1833 windowList.at(i)->geolocationClientMock()->setPositionUnavailableError(W ebString::fromUTF8(arguments[0].toString()));
1834 }
1835
1836 void TestRunner::setMIDIAccessorResult(const CppArgumentList& arguments, CppVari ant* result) 1794 void TestRunner::setMIDIAccessorResult(const CppArgumentList& arguments, CppVari ant* result)
1837 { 1795 {
1838 result->setNull(); 1796 result->setNull();
1839 if (arguments.size() < 1 || !arguments[0].isBool()) 1797 if (arguments.size() < 1 || !arguments[0].isBool())
1840 return; 1798 return;
1841 m_midiAccessorResult = arguments[0].toBoolean(); 1799 m_midiAccessorResult = arguments[0].toBoolean();
1842 } 1800 }
1843 1801
1844 void TestRunner::setMIDISysExPermission(const CppArgumentList& arguments, CppVar iant* result) 1802 void TestRunner::setMIDISysExPermission(const CppArgumentList& arguments, CppVar iant* result)
1845 { 1803 {
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 result->setNull(); 2106 result->setNull();
2149 } 2107 }
2150 2108
2151 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp Variant* result) 2109 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp Variant* result)
2152 { 2110 {
2153 m_pointerLockPlannedResult = PointerLockWillFailSync; 2111 m_pointerLockPlannedResult = PointerLockWillFailSync;
2154 result->setNull(); 2112 result->setNull();
2155 } 2113 }
2156 2114
2157 } 2115 }
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/TestRunner.h ('k') | content/shell/renderer/test_runner/WebTestProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698