Skip to content

Commit ba27c58

Browse files
author
Mykola Tryshnivskyy
committed
Fixed compilation warnings
1 parent 4fc5ede commit ba27c58

File tree

3 files changed

+203
-203
lines changed

3 files changed

+203
-203
lines changed

src/chrome/test/webdriver/webdriver_automation.cc

Lines changed: 162 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ void Automation::DragAndDropFilePaths(const WebViewId &view_id, const Point &loc
509509
QMimeData data;
510510
QList<QUrl> urls;
511511

512-
for (int i = 0; i < paths.size(); i++)
512+
for (uint i = 0; i < paths.size(); i++)
513513
urls.append(QUrl(paths.at(i).c_str()));
514514

515515
data.setUrls(urls);
@@ -592,19 +592,19 @@ void Automation::SendNativeKeyEvent(const WebViewId &view_id, ui::KeyboardCode k
592592
QApplication::sendEvent(view, &releaseKeyEvent);
593593
}
594594

595-
void Automation::SendWebMouseEvent(const WebViewId &view_id, const WebMouseEvent &event, Error **error)
596-
{
597-
/*WebViewLocator view_locator;
598-
*error = ConvertViewIdToLocator(view_id, &view_locator);
599-
if (*error)
600-
return;
595+
//void Automation::SendWebMouseEvent(const WebViewId &view_id, const WebMouseEvent &event, Error **error)
596+
//{
597+
// WebViewLocator view_locator;
598+
// *error = ConvertViewIdToLocator(view_id, &view_locator);
599+
// if (*error)
600+
// return;
601601

602-
automation::Error auto_error;
603-
if (!SendWebMouseEventJSONRequest(
604-
automation(), view_locator, event, &auto_error)) {
605-
*error = Error::FromAutomationError(auto_error);
606-
}*/
607-
}
602+
// automation::Error auto_error;
603+
// if (!SendWebMouseEventJSONRequest(
604+
// automation(), view_locator, event, &auto_error)) {
605+
// *error = Error::FromAutomationError(auto_error);
606+
// }
607+
//}
608608

609609
void Automation::CaptureEntirePageAsPNG(const WebViewId &view_id, const FilePath &path, Error **error)
610610
{
@@ -628,21 +628,21 @@ void Automation::CaptureEntirePageAsPNG(const WebViewId &view_id, const FilePath
628628
}
629629
}
630630

631-
#if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS))
632-
void Automation::HeapProfilerDump(const WebViewId &view_id, const std::string &reason, Error **error)
633-
{
634-
/*WebViewLocator view_locator;
635-
*error = ConvertViewIdToLocator(view_id, &view_locator);
636-
if (*error)
637-
return;
631+
//#if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS))
632+
//void Automation::HeapProfilerDump(const WebViewId &view_id, const std::string &reason, Error **error)
633+
//{
634+
// WebViewLocator view_locator;
635+
// *error = ConvertViewIdToLocator(view_id, &view_locator);
636+
// if (*error)
637+
// return;
638638

639-
automation::Error auto_error;
640-
if (!SendHeapProfilerDumpJSONRequest(
641-
automation(), view_locator, reason, &auto_error)) {
642-
*error = Error::FromAutomationError(auto_error);
643-
}*/
644-
}
645-
#endif // !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS))
639+
// automation::Error auto_error;
640+
// if (!SendHeapProfilerDumpJSONRequest(
641+
// automation(), view_locator, reason, &auto_error)) {
642+
// *error = Error::FromAutomationError(auto_error);
643+
// }
644+
//}
645+
//#endif // !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS))
646646

647647
void Automation::NavigateToURL(const WebViewId &view_id, const std::string &url, Error **error)
648648
{
@@ -748,7 +748,7 @@ void Automation::GetCookies(const WebViewId &view_id, const std::string &url, ba
748748
QList<QNetworkCookie> cookies_list = jar->cookiesForUrl(QUrl(qUrl));
749749

750750
ListValue* list = new ListValue();
751-
for (size_t i = 0; i < cookies_list.size(); ++i)
751+
for (int i = 0; i < cookies_list.size(); ++i)
752752
{
753753
const QNetworkCookie& cookie = cookies_list[i];
754754

@@ -1821,154 +1821,154 @@ void Automation::AcceptPromptAppModalDialog(const WebViewId& view_id,
18211821
}*/
18221822
}
18231823

1824-
void Automation::GetBrowserVersion(std::string* version)
1825-
{
1826-
// *version = automation()->server_version();
1827-
}
1824+
//void Automation::GetBrowserVersion(std::string* version)
1825+
//{
1826+
// *version = automation()->server_version();
1827+
//}
18281828

1829-
void Automation::GetChromeDriverAutomationVersion(int* version, Error** error)
1830-
{
1831-
/* automation::Error auto_error;
1832-
if (!SendGetChromeDriverAutomationVersion(automation(), version, &auto_error))
1833-
*error = Error::FromAutomationError(auto_error);*/
1834-
}
1829+
//void Automation::GetChromeDriverAutomationVersion(int* version, Error** error)
1830+
//{
1831+
// automation::Error auto_error;
1832+
// if (!SendGetChromeDriverAutomationVersion(automation(), version, &auto_error))
1833+
// *error = Error::FromAutomationError(auto_error);
1834+
//}
18351835

1836-
void Automation::WaitForAllViewsToStopLoading(Error** error)
1837-
{
1838-
/* automation::Error auto_error;
1839-
if (!SendWaitForAllViewsToStopLoadingJSONRequest(automation(), &auto_error))
1840-
*error = Error::FromAutomationError(auto_error);*/
1841-
}
1836+
//void Automation::WaitForAllViewsToStopLoading(Error** error)
1837+
//{
1838+
// automation::Error auto_error;
1839+
// if (!SendWaitForAllViewsToStopLoadingJSONRequest(automation(), &auto_error))
1840+
// *error = Error::FromAutomationError(auto_error);
1841+
//}
18421842

1843-
void Automation::InstallExtension(const FilePath &path, std::string *extension_id, Error **error)
1844-
{
1845-
/**error = CheckNewExtensionInterfaceSupported();
1846-
if (*error)
1847-
return;
1843+
//void Automation::InstallExtension(const FilePath &path, std::string *extension_id, Error **error)
1844+
//{
1845+
// *error = CheckNewExtensionInterfaceSupported();
1846+
// if (*error)
1847+
// return;
18481848

1849-
automation::Error auto_error;
1850-
if (!SendInstallExtensionJSONRequest(
1851-
automation(), path, false /* with_ui *//*, extension_id,
1852-
&auto_error))
1853-
*error = Error::FromAutomationError(auto_error);*/
1854-
}
1849+
// automation::Error auto_error;
1850+
// if (!SendInstallExtensionJSONRequest(
1851+
// automation(), path, false /* with_ui */, extension_id,
1852+
// &auto_error))
1853+
// *error = Error::FromAutomationError(auto_error);
1854+
//}
18551855

1856-
void Automation::GetExtensionsInfo(
1857-
base::ListValue* extensions_list, Error** error)
1858-
{
1859-
/**error = CheckNewExtensionInterfaceSupported();
1860-
if (*error)
1861-
return;
1856+
//void Automation::GetExtensionsInfo(
1857+
// base::ListValue* extensions_list, Error** error)
1858+
//{
1859+
// *error = CheckNewExtensionInterfaceSupported();
1860+
// if (*error)
1861+
// return;
18621862

1863-
automation::Error auto_error;
1864-
if (!SendGetExtensionsInfoJSONRequest(
1865-
automation(), extensions_list, &auto_error))
1866-
*error = Error::FromAutomationError(auto_error);*/
1867-
}
1863+
// automation::Error auto_error;
1864+
// if (!SendGetExtensionsInfoJSONRequest(
1865+
// automation(), extensions_list, &auto_error))
1866+
// *error = Error::FromAutomationError(auto_error);
1867+
//}
18681868

1869-
void Automation::IsPageActionVisible(const WebViewId &tab_id, const std::string &extension_id,
1870-
bool *is_visible, Error **error)
1871-
{
1872-
/**error = CheckNewExtensionInterfaceSupported();
1873-
if (*error)
1874-
return;
1869+
//void Automation::IsPageActionVisible(const WebViewId &tab_id, const std::string &extension_id,
1870+
// bool *is_visible, Error **error)
1871+
//{
1872+
// *error = CheckNewExtensionInterfaceSupported();
1873+
// if (*error)
1874+
// return;
18751875

1876-
automation::Error auto_error;
1877-
if (!SendIsPageActionVisibleJSONRequest(
1878-
automation(), tab_id, extension_id, is_visible, &auto_error))
1879-
*error = Error::FromAutomationError(auto_error);*/
1880-
}
1876+
// automation::Error auto_error;
1877+
// if (!SendIsPageActionVisibleJSONRequest(
1878+
// automation(), tab_id, extension_id, is_visible, &auto_error))
1879+
// *error = Error::FromAutomationError(auto_error);
1880+
//}
18811881

1882-
void Automation::SetExtensionState(
1883-
const std::string& extension_id,
1884-
bool enable,
1885-
Error** error)
1886-
{
1887-
/**error = CheckNewExtensionInterfaceSupported();
1888-
if (*error)
1889-
return;
1882+
//void Automation::SetExtensionState(
1883+
// const std::string& extension_id,
1884+
// bool enable,
1885+
// Error** error)
1886+
//{
1887+
// *error = CheckNewExtensionInterfaceSupported();
1888+
// if (*error)
1889+
// return;
18901890

1891-
automation::Error auto_error;
1892-
if (!SendSetExtensionStateJSONRequest(
1893-
automation(), extension_id, enable /* enable *//*,
1894-
false /* allow_in_incognito *//*, &auto_error))
1895-
*error = Error::FromAutomationError(auto_error);*/
1896-
}
1891+
// automation::Error auto_error;
1892+
// if (!SendSetExtensionStateJSONRequest(
1893+
// automation(), extension_id, enable /* enable */,
1894+
// false /* allow_in_incognito */, &auto_error))
1895+
// *error = Error::FromAutomationError(auto_error);
1896+
//}
18971897

1898-
void Automation::ClickExtensionButton(
1899-
const std::string& extension_id,
1900-
bool browser_action,
1901-
Error** error)
1902-
{
1903-
/*automation::Error auto_error;
1904-
if (!SendClickExtensionButtonJSONRequest(
1905-
automation(), extension_id, browser_action, &auto_error))
1906-
*error = Error::FromAutomationError(auto_error);*/
1907-
}
1898+
//void Automation::ClickExtensionButton(
1899+
// const std::string& extension_id,
1900+
// bool browser_action,
1901+
// Error** error)
1902+
//{
1903+
// automation::Error auto_error;
1904+
// if (!SendClickExtensionButtonJSONRequest(
1905+
// automation(), extension_id, browser_action, &auto_error))
1906+
// *error = Error::FromAutomationError(auto_error);
1907+
//}
19081908

1909-
void Automation::UninstallExtension(
1910-
const std::string& extension_id, Error** error)
1911-
{
1912-
/**error = CheckNewExtensionInterfaceSupported();
1913-
if (*error)
1914-
return;
1909+
//void Automation::UninstallExtension(
1910+
// const std::string& extension_id, Error** error)
1911+
//{
1912+
// *error = CheckNewExtensionInterfaceSupported();
1913+
// if (*error)
1914+
// return;
19151915

1916-
automation::Error auto_error;
1917-
if (!SendUninstallExtensionJSONRequest(
1918-
automation(), extension_id, &auto_error))
1919-
*error = Error::FromAutomationError(auto_error);*/
1920-
}
1916+
// automation::Error auto_error;
1917+
// if (!SendUninstallExtensionJSONRequest(
1918+
// automation(), extension_id, &auto_error))
1919+
// *error = Error::FromAutomationError(auto_error);
1920+
//}
19211921

1922-
void Automation::SetLocalStatePreference(const std::string &pref, base::Value *value, Error **error)
1923-
{
1924-
/*scoped_ptr<Value> scoped_value(value);
1925-
// In version 927, SetLocalStatePrefs was changed from taking a browser
1926-
// handle to a browser index.
1927-
if (build_no_ >= 927) {
1928-
automation::Error auto_error;
1929-
if (!SendSetLocalStatePreferenceJSONRequest(
1930-
automation(), pref, scoped_value.release(), &auto_error))
1931-
*error = Error::FromAutomationError(auto_error);
1932-
} else {
1933-
std::string request, response;
1934-
DictionaryValue request_dict;
1935-
request_dict.SetString("command", "SetLocalStatePrefs");
1936-
request_dict.SetString("path", pref);
1937-
request_dict.Set("value", scoped_value.release());
1938-
base::JSONWriter::Write(&request_dict, &request);
1939-
if (!automation()->GetBrowserWindow(0)->SendJSONRequest(
1940-
request, -1, &response)) {
1941-
*error = new Error(kUnknownError, base::StringPrintf(
1942-
"Failed to set local state pref '%s'", pref.c_str()));
1943-
}
1944-
}*/
1945-
}
1922+
//void Automation::SetLocalStatePreference(const std::string &pref, base::Value *value, Error **error)
1923+
//{
1924+
// scoped_ptr<Value> scoped_value(value);
1925+
// // In version 927, SetLocalStatePrefs was changed from taking a browser
1926+
// // handle to a browser index.
1927+
// if (build_no_ >= 927) {
1928+
// automation::Error auto_error;
1929+
// if (!SendSetLocalStatePreferenceJSONRequest(
1930+
// automation(), pref, scoped_value.release(), &auto_error))
1931+
// *error = Error::FromAutomationError(auto_error);
1932+
// } else {
1933+
// std::string request, response;
1934+
// DictionaryValue request_dict;
1935+
// request_dict.SetString("command", "SetLocalStatePrefs");
1936+
// request_dict.SetString("path", pref);
1937+
// request_dict.Set("value", scoped_value.release());
1938+
// base::JSONWriter::Write(&request_dict, &request);
1939+
// if (!automation()->GetBrowserWindow(0)->SendJSONRequest(
1940+
// request, -1, &response)) {
1941+
// *error = new Error(kUnknownError, base::StringPrintf(
1942+
// "Failed to set local state pref '%s'", pref.c_str()));
1943+
// }
1944+
// }
1945+
//}
19461946

1947-
void Automation::SetPreference(const std::string &pref, base::Value *value, Error **error)
1948-
{
1949-
/*scoped_ptr<Value> scoped_value(value);
1950-
// Chrome 17 is on the 963 branch. The first released 18 build should have
1951-
// the new SetPrefs method which uses a browser index instead of handle.
1952-
if (build_no_ >= 964) {
1953-
automation::Error auto_error;
1954-
if (!SendSetPreferenceJSONRequest(
1955-
automation(), pref, scoped_value.release(), &auto_error))
1956-
*error = Error::FromAutomationError(auto_error);
1957-
} else {
1958-
std::string request, response;
1959-
DictionaryValue request_dict;
1960-
request_dict.SetString("command", "SetPrefs");
1961-
request_dict.SetInteger("windex", 0);
1962-
request_dict.SetString("path", pref);
1963-
request_dict.Set("value", scoped_value.release());
1964-
base::JSONWriter::Write(&request_dict, &request);
1965-
if (!automation()->GetBrowserWindow(0)->SendJSONRequest(
1966-
request, -1, &response)) {
1967-
*error = new Error(kUnknownError, base::StringPrintf(
1968-
"Failed to set pref '%s'", pref.c_str()));
1969-
}
1970-
}*/
1971-
}
1947+
//void Automation::SetPreference(const std::string &pref, base::Value *value, Error **error)
1948+
//{
1949+
// scoped_ptr<Value> scoped_value(value);
1950+
// // Chrome 17 is on the 963 branch. The first released 18 build should have
1951+
// // the new SetPrefs method which uses a browser index instead of handle.
1952+
// if (build_no_ >= 964) {
1953+
// automation::Error auto_error;
1954+
// if (!SendSetPreferenceJSONRequest(
1955+
// automation(), pref, scoped_value.release(), &auto_error))
1956+
// *error = Error::FromAutomationError(auto_error);
1957+
// } else {
1958+
// std::string request, response;
1959+
// DictionaryValue request_dict;
1960+
// request_dict.SetString("command", "SetPrefs");
1961+
// request_dict.SetInteger("windex", 0);
1962+
// request_dict.SetString("path", pref);
1963+
// request_dict.Set("value", scoped_value.release());
1964+
// base::JSONWriter::Write(&request_dict, &request);
1965+
// if (!automation()->GetBrowserWindow(0)->SendJSONRequest(
1966+
// request, -1, &response)) {
1967+
// *error = new Error(kUnknownError, base::StringPrintf(
1968+
// "Failed to set pref '%s'", pref.c_str()));
1969+
// }
1970+
// }
1971+
//}
19721972

19731973
void Automation::GetGeolocation(scoped_ptr<base::DictionaryValue> *geolocation, Error **error)
19741974
{
@@ -2067,7 +2067,7 @@ Error* Automation::CheckMaximizeSupported()
20672067

20682068
QWebView *Automation::ConvertViewIdToPointer(const WebViewId& view_id)
20692069
{
2070-
AutomationId id = view_id.GetId();
2070+
//AutomationId id = view_id.GetId();
20712071
return NULL;
20722072
}
20732073

0 commit comments

Comments
 (0)