OLD | NEW |
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 #include "content/shell/renderer/test_runner/WebTestProxy.h" | 5 #include "content/shell/renderer/test_runner/WebTestProxy.h" |
6 | 6 |
7 #include <cctype> | 7 #include <cctype> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/shell/renderer/test_runner/event_sender.h" | 10 #include "content/shell/renderer/test_runner/event_sender.h" |
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 size_t fileProtocol = newMessage.find("file://"); | 1300 size_t fileProtocol = newMessage.find("file://"); |
1301 if (fileProtocol != string::npos) { | 1301 if (fileProtocol != string::npos) { |
1302 newMessage = newMessage.substr(0, fileProtocol) | 1302 newMessage = newMessage.substr(0, fileProtocol) |
1303 + urlSuitableForTestResult(newMessage.substr(fileProtocol)); | 1303 + urlSuitableForTestResult(newMessage.substr(fileProtocol)); |
1304 } | 1304 } |
1305 m_delegate->printMessage(newMessage); | 1305 m_delegate->printMessage(newMessage); |
1306 } | 1306 } |
1307 m_delegate->printMessage(string("\n")); | 1307 m_delegate->printMessage(string("\n")); |
1308 } | 1308 } |
1309 | 1309 |
1310 void WebTestProxyBase::runModalAlertDialog(WebLocalFrame*, const WebString& mess
age) | |
1311 { | |
1312 m_delegate->printMessage(string("ALERT: ") + message.utf8().data() + "\n"); | |
1313 } | |
1314 | |
1315 bool WebTestProxyBase::runModalConfirmDialog(WebLocalFrame*, const WebString& me
ssage) | |
1316 { | |
1317 m_delegate->printMessage(string("CONFIRM: ") + message.utf8().data() + "\n")
; | |
1318 return true; | |
1319 } | |
1320 | |
1321 bool WebTestProxyBase::runModalPromptDialog(WebLocalFrame* frame, const WebStrin
g& message, const WebString& defaultValue, WebString*) | |
1322 { | |
1323 m_delegate->printMessage(string("PROMPT: ") + message.utf8().data() + ", def
ault text: " + defaultValue.utf8().data() + "\n"); | |
1324 return true; | |
1325 } | |
1326 | |
1327 bool WebTestProxyBase::runModalBeforeUnloadDialog(WebLocalFrame*, const WebStrin
g& message) | |
1328 { | |
1329 m_delegate->printMessage(string("CONFIRM NAVIGATION: ") + message.utf8().dat
a() + "\n"); | |
1330 return !m_testInterfaces->testRunner()->shouldStayOnPageAfterHandlingBeforeU
nload(); | |
1331 } | |
1332 | |
1333 void WebTestProxyBase::locationChangeDone(WebFrame* frame) | 1310 void WebTestProxyBase::locationChangeDone(WebFrame* frame) |
1334 { | 1311 { |
1335 if (frame != m_testInterfaces->testRunner()->topLoadingFrame()) | 1312 if (frame != m_testInterfaces->testRunner()->topLoadingFrame()) |
1336 return; | 1313 return; |
1337 m_testInterfaces->testRunner()->setTopLoadingFrame(frame, true); | 1314 m_testInterfaces->testRunner()->setTopLoadingFrame(frame, true); |
1338 } | 1315 } |
1339 | 1316 |
1340 WebNavigationPolicy WebTestProxyBase::decidePolicyForNavigation(WebLocalFrame*,
WebDataSource::ExtraData*, const WebURLRequest& request, WebNavigationType type,
WebNavigationPolicy defaultPolicy, bool isRedirect) | 1317 WebNavigationPolicy WebTestProxyBase::decidePolicyForNavigation(WebLocalFrame*,
WebDataSource::ExtraData*, const WebURLRequest& request, WebNavigationType type,
WebNavigationPolicy defaultPolicy, bool isRedirect) |
1341 { | 1318 { |
1342 WebNavigationPolicy result; | 1319 WebNavigationPolicy result; |
(...skipping 30 matching lines...) Expand all Loading... |
1373 | 1350 |
1374 void WebTestProxyBase::resetInputMethod() | 1351 void WebTestProxyBase::resetInputMethod() |
1375 { | 1352 { |
1376 // If a composition text exists, then we need to let the browser process | 1353 // If a composition text exists, then we need to let the browser process |
1377 // to cancel the input method's ongoing composition session. | 1354 // to cancel the input method's ongoing composition session. |
1378 if (m_webWidget) | 1355 if (m_webWidget) |
1379 m_webWidget->confirmComposition(); | 1356 m_webWidget->confirmComposition(); |
1380 } | 1357 } |
1381 | 1358 |
1382 } | 1359 } |
OLD | NEW |