| 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 "content/shell/renderer/test_runner/AccessibilityController.h" | 9 #include "content/shell/renderer/test_runner/AccessibilityController.h" |
| 10 #include "content/shell/renderer/test_runner/EventSender.h" | 10 #include "content/shell/renderer/test_runner/EventSender.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 27 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 28 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 28 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 29 #include "third_party/WebKit/public/web/WebAXEnums.h" | 29 #include "third_party/WebKit/public/web/WebAXEnums.h" |
| 30 #include "third_party/WebKit/public/web/WebAXObject.h" | 30 #include "third_party/WebKit/public/web/WebAXObject.h" |
| 31 #include "third_party/WebKit/public/web/WebCachedURLRequest.h" | 31 #include "third_party/WebKit/public/web/WebCachedURLRequest.h" |
| 32 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 32 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
| 33 #include "third_party/WebKit/public/web/WebDataSource.h" | 33 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 34 #include "third_party/WebKit/public/web/WebDocument.h" | 34 #include "third_party/WebKit/public/web/WebDocument.h" |
| 35 #include "third_party/WebKit/public/web/WebElement.h" | 35 #include "third_party/WebKit/public/web/WebElement.h" |
| 36 #include "third_party/WebKit/public/web/WebFrame.h" | 36 #include "third_party/WebKit/public/web/WebFrame.h" |
| 37 #include "third_party/WebKit/public/web/WebGeolocationClientMock.h" | |
| 38 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 37 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
| 39 #include "third_party/WebKit/public/web/WebMIDIClientMock.h" | 38 #include "third_party/WebKit/public/web/WebMIDIClientMock.h" |
| 40 #include "third_party/WebKit/public/web/WebNode.h" | 39 #include "third_party/WebKit/public/web/WebNode.h" |
| 41 #include "third_party/WebKit/public/web/WebPluginParams.h" | 40 #include "third_party/WebKit/public/web/WebPluginParams.h" |
| 42 #include "third_party/WebKit/public/web/WebPrintParams.h" | 41 #include "third_party/WebKit/public/web/WebPrintParams.h" |
| 43 #include "third_party/WebKit/public/web/WebRange.h" | 42 #include "third_party/WebKit/public/web/WebRange.h" |
| 44 #include "third_party/WebKit/public/web/WebScriptController.h" | 43 #include "third_party/WebKit/public/web/WebScriptController.h" |
| 45 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 44 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
| 46 #include "third_party/WebKit/public/web/WebView.h" | 45 #include "third_party/WebKit/public/web/WebView.h" |
| 47 | 46 |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 } | 418 } |
| 420 | 419 |
| 421 void WebTestProxyBase::reset() | 420 void WebTestProxyBase::reset() |
| 422 { | 421 { |
| 423 m_paintRect = WebRect(); | 422 m_paintRect = WebRect(); |
| 424 m_canvas.reset(); | 423 m_canvas.reset(); |
| 425 m_isPainting = false; | 424 m_isPainting = false; |
| 426 m_animateScheduled = false; | 425 m_animateScheduled = false; |
| 427 m_resourceIdentifierMap.clear(); | 426 m_resourceIdentifierMap.clear(); |
| 428 m_logConsoleOutput = true; | 427 m_logConsoleOutput = true; |
| 429 if (m_geolocationClient.get()) | |
| 430 m_geolocationClient->resetMock(); | |
| 431 if (m_midiClient.get()) | 428 if (m_midiClient.get()) |
| 432 m_midiClient->resetMock(); | 429 m_midiClient->resetMock(); |
| 433 #if ENABLE_INPUT_SPEECH | 430 #if ENABLE_INPUT_SPEECH |
| 434 if (m_speechInputController.get()) | 431 if (m_speechInputController.get()) |
| 435 m_speechInputController->clearResults(); | 432 m_speechInputController->clearResults(); |
| 436 #endif | 433 #endif |
| 437 } | 434 } |
| 438 | 435 |
| 439 WebSpellCheckClient* WebTestProxyBase::spellCheckClient() const | 436 WebSpellCheckClient* WebTestProxyBase::spellCheckClient() const |
| 440 { | 437 { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 { | 656 { |
| 660 paintInvalidatedRegion(); | 657 paintInvalidatedRegion(); |
| 661 displayRepaintMask(); | 658 displayRepaintMask(); |
| 662 } | 659 } |
| 663 | 660 |
| 664 void WebTestProxyBase::discardBackingStore() | 661 void WebTestProxyBase::discardBackingStore() |
| 665 { | 662 { |
| 666 m_canvas.reset(); | 663 m_canvas.reset(); |
| 667 } | 664 } |
| 668 | 665 |
| 669 WebGeolocationClientMock* WebTestProxyBase::geolocationClientMock() | |
| 670 { | |
| 671 if (!m_geolocationClient.get()) | |
| 672 m_geolocationClient.reset(WebGeolocationClientMock::create()); | |
| 673 return m_geolocationClient.get(); | |
| 674 } | |
| 675 | |
| 676 WebMIDIClientMock* WebTestProxyBase::midiClientMock() | 666 WebMIDIClientMock* WebTestProxyBase::midiClientMock() |
| 677 { | 667 { |
| 678 if (!m_midiClient.get()) | 668 if (!m_midiClient.get()) |
| 679 m_midiClient.reset(new WebMIDIClientMock); | 669 m_midiClient.reset(new WebMIDIClientMock); |
| 680 return m_midiClient.get(); | 670 return m_midiClient.get(); |
| 681 } | 671 } |
| 682 | 672 |
| 683 #if ENABLE_INPUT_SPEECH | 673 #if ENABLE_INPUT_SPEECH |
| 684 MockWebSpeechInputController* WebTestProxyBase::speechInputControllerMock() | 674 MockWebSpeechInputController* WebTestProxyBase::speechInputControllerMock() |
| 685 { | 675 { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 WebPrintParams printParams(pageSizeInPixels); | 934 WebPrintParams printParams(pageSizeInPixels); |
| 945 frame->printBegin(printParams); | 935 frame->printBegin(printParams); |
| 946 frame->printEnd(); | 936 frame->printEnd(); |
| 947 } | 937 } |
| 948 | 938 |
| 949 WebNotificationPresenter* WebTestProxyBase::notificationPresenter() | 939 WebNotificationPresenter* WebTestProxyBase::notificationPresenter() |
| 950 { | 940 { |
| 951 return m_testInterfaces->testRunner()->notificationPresenter(); | 941 return m_testInterfaces->testRunner()->notificationPresenter(); |
| 952 } | 942 } |
| 953 | 943 |
| 954 WebGeolocationClient* WebTestProxyBase::geolocationClient() | |
| 955 { | |
| 956 return geolocationClientMock(); | |
| 957 } | |
| 958 | |
| 959 WebMIDIClient* WebTestProxyBase::webMIDIClient() | 944 WebMIDIClient* WebTestProxyBase::webMIDIClient() |
| 960 { | 945 { |
| 961 return midiClientMock(); | 946 return midiClientMock(); |
| 962 } | 947 } |
| 963 | 948 |
| 964 WebSpeechInputController* WebTestProxyBase::speechInputController(WebSpeechInput
Listener* listener) | 949 WebSpeechInputController* WebTestProxyBase::speechInputController(WebSpeechInput
Listener* listener) |
| 965 { | 950 { |
| 966 #if ENABLE_INPUT_SPEECH | 951 #if ENABLE_INPUT_SPEECH |
| 967 if (!m_speechInputController.get()) { | 952 if (!m_speechInputController.get()) { |
| 968 m_speechInputController.reset(new MockWebSpeechInputController(listener)
); | 953 m_speechInputController.reset(new MockWebSpeechInputController(listener)
); |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 | 1346 |
| 1362 void WebTestProxyBase::resetInputMethod() | 1347 void WebTestProxyBase::resetInputMethod() |
| 1363 { | 1348 { |
| 1364 // If a composition text exists, then we need to let the browser process | 1349 // If a composition text exists, then we need to let the browser process |
| 1365 // to cancel the input method's ongoing composition session. | 1350 // to cancel the input method's ongoing composition session. |
| 1366 if (m_webWidget) | 1351 if (m_webWidget) |
| 1367 m_webWidget->confirmComposition(); | 1352 m_webWidget->confirmComposition(); |
| 1368 } | 1353 } |
| 1369 | 1354 |
| 1370 } | 1355 } |
| OLD | NEW |