OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "WebTestProxy.h" | 32 #include "WebTestProxy.h" |
33 | 33 |
34 #include "AccessibilityControllerChromium.h" | 34 #include "AccessibilityControllerChromium.h" |
35 #include "EventSender.h" | 35 #include "EventSender.h" |
| 36 #include "MockColorChooser.h" |
36 #include "MockWebSpeechInputController.h" | 37 #include "MockWebSpeechInputController.h" |
37 #include "MockWebSpeechRecognizer.h" | 38 #include "MockWebSpeechRecognizer.h" |
38 #include "SpellCheckClient.h" | 39 #include "SpellCheckClient.h" |
39 #include "TestCommon.h" | 40 #include "TestCommon.h" |
40 #include "TestInterfaces.h" | 41 #include "TestInterfaces.h" |
41 #include "TestPlugin.h" | 42 #include "TestPlugin.h" |
42 #include "TestRunner.h" | 43 #include "TestRunner.h" |
43 #include "WebAccessibilityNotification.h" | 44 #include "WebAccessibilityNotification.h" |
44 #include "WebAccessibilityObject.h" | 45 #include "WebAccessibilityObject.h" |
45 #include "WebCachedURLRequest.h" | 46 #include "WebCachedURLRequest.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 } | 433 } |
433 return result; | 434 return result; |
434 } | 435 } |
435 | 436 |
436 } | 437 } |
437 | 438 |
438 WebTestProxyBase::WebTestProxyBase() | 439 WebTestProxyBase::WebTestProxyBase() |
439 : m_testInterfaces(0) | 440 : m_testInterfaces(0) |
440 , m_delegate(0) | 441 , m_delegate(0) |
441 , m_spellcheck(new SpellCheckClient) | 442 , m_spellcheck(new SpellCheckClient) |
| 443 , m_chooserCount(0) |
442 { | 444 { |
443 reset(); | 445 reset(); |
444 } | 446 } |
445 | 447 |
446 WebTestProxyBase::~WebTestProxyBase() | 448 WebTestProxyBase::~WebTestProxyBase() |
447 { | 449 { |
448 m_testInterfaces->windowClosed(this); | 450 m_testInterfaces->windowClosed(this); |
449 } | 451 } |
450 | 452 |
451 void WebTestProxyBase::setInterfaces(WebTestInterfaces* interfaces) | 453 void WebTestProxyBase::setInterfaces(WebTestInterfaces* interfaces) |
(...skipping 27 matching lines...) Expand all Loading... |
479 if (m_speechInputController.get()) | 481 if (m_speechInputController.get()) |
480 m_speechInputController->clearResults(); | 482 m_speechInputController->clearResults(); |
481 #endif | 483 #endif |
482 } | 484 } |
483 | 485 |
484 WebSpellCheckClient* WebTestProxyBase::spellCheckClient() const | 486 WebSpellCheckClient* WebTestProxyBase::spellCheckClient() const |
485 { | 487 { |
486 return m_spellcheck.get(); | 488 return m_spellcheck.get(); |
487 } | 489 } |
488 | 490 |
| 491 WebColorChooser* WebTestProxyBase::createColorChooser(WebColorChooserClient* cli
ent, const WebKit::WebColor& color) |
| 492 { |
| 493 // This instance is deleted by WebCore::ColorInputType |
| 494 return new MockColorChooser(client, m_delegate, this); |
| 495 } |
| 496 |
489 string WebTestProxyBase::captureTree(bool debugRenderTree) | 497 string WebTestProxyBase::captureTree(bool debugRenderTree) |
490 { | 498 { |
491 WebScriptController::flushConsoleMessages(); | 499 WebScriptController::flushConsoleMessages(); |
492 | 500 |
493 bool shouldDumpAsText = m_testInterfaces->testRunner()->shouldDumpAsText(); | 501 bool shouldDumpAsText = m_testInterfaces->testRunner()->shouldDumpAsText(); |
494 bool shouldDumpAsPrinted = m_testInterfaces->testRunner()->isPrinting(); | 502 bool shouldDumpAsPrinted = m_testInterfaces->testRunner()->isPrinting(); |
495 WebFrame* frame = m_testInterfaces->webView()->mainFrame(); | 503 WebFrame* frame = m_testInterfaces->webView()->mainFrame(); |
496 string dataUtf8; | 504 string dataUtf8; |
497 if (shouldDumpAsText) { | 505 if (shouldDumpAsText) { |
498 bool recursive = m_testInterfaces->testRunner()->shouldDumpChildFramesAs
Text(); | 506 bool recursive = m_testInterfaces->testRunner()->shouldDumpChildFramesAs
Text(); |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 void WebTestProxyBase::didBlur() | 1074 void WebTestProxyBase::didBlur() |
1067 { | 1075 { |
1068 m_delegate->setFocus(this, false); | 1076 m_delegate->setFocus(this, false); |
1069 } | 1077 } |
1070 | 1078 |
1071 void WebTestProxyBase::setToolTipText(const WebString& text, WebTextDirection) | 1079 void WebTestProxyBase::setToolTipText(const WebString& text, WebTextDirection) |
1072 { | 1080 { |
1073 m_testInterfaces->testRunner()->setToolTipText(text); | 1081 m_testInterfaces->testRunner()->setToolTipText(text); |
1074 } | 1082 } |
1075 | 1083 |
| 1084 void WebTestProxyBase::didOpenChooser() |
| 1085 { |
| 1086 m_chooserCount++; |
| 1087 } |
| 1088 |
| 1089 void WebTestProxyBase::didCloseChooser() |
| 1090 { |
| 1091 m_chooserCount--; |
| 1092 } |
| 1093 |
| 1094 bool WebTestProxyBase::isChooserShown() |
| 1095 { |
| 1096 return 0 < m_chooserCount; |
| 1097 } |
| 1098 |
1076 void WebTestProxyBase::willPerformClientRedirect(WebFrame* frame, const WebURL&,
const WebURL& to, double, double) | 1099 void WebTestProxyBase::willPerformClientRedirect(WebFrame* frame, const WebURL&,
const WebURL& to, double, double) |
1077 { | 1100 { |
1078 if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { | 1101 if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { |
1079 printFrameDescription(m_delegate, frame); | 1102 printFrameDescription(m_delegate, frame); |
1080 m_delegate->printMessage(string(" - willPerformClientRedirectToURL: ") +
to.spec().data() + " \n"); | 1103 m_delegate->printMessage(string(" - willPerformClientRedirectToURL: ") +
to.spec().data() + " \n"); |
1081 } | 1104 } |
1082 | 1105 |
1083 if (m_testInterfaces->testRunner()->shouldDumpUserGestureInFrameLoadCallback
s()) | 1106 if (m_testInterfaces->testRunner()->shouldDumpUserGestureInFrameLoadCallback
s()) |
1084 printFrameUserGestureStatus(m_delegate, frame, " - in willPerformClientR
edirect\n"); | 1107 printFrameUserGestureStatus(m_delegate, frame, " - in willPerformClientR
edirect\n"); |
1085 } | 1108 } |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 { | 1490 { |
1468 if (m_testInterfaces->testRunner()->shouldInterceptPostMessage()) { | 1491 if (m_testInterfaces->testRunner()->shouldInterceptPostMessage()) { |
1469 m_delegate->printMessage("intercepted postMessage\n"); | 1492 m_delegate->printMessage("intercepted postMessage\n"); |
1470 return true; | 1493 return true; |
1471 } | 1494 } |
1472 | 1495 |
1473 return false; | 1496 return false; |
1474 } | 1497 } |
1475 | 1498 |
1476 } | 1499 } |
OLD | NEW |