Title: [122804] trunk/Tools
- Revision
- 122804
- Author
- [email protected]
- Date
- 2012-07-16 21:00:50 -0700 (Mon, 16 Jul 2012)
Log Message
[Chromium] AccessibilityController shouldn't know anything about TestShell
https://bugs.webkit.org/show_bug.cgi?id=91441
Reviewed by Tony Chang.
This patch is a precursor to moving AccessibilityController.cpp into TestRunner.a.
* DumpRenderTree/chromium/AccessibilityController.cpp:
(AccessibilityController::AccessibilityController):
(AccessibilityController::getFocusedElement):
(AccessibilityController::getRootElement):
* DumpRenderTree/chromium/AccessibilityController.h:
(WebKit):
(AccessibilityController):
(AccessibilityController::setWebView):
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::initialize):
(TestShell::createMainWindow):
(TestShell::~TestShell):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (122803 => 122804)
--- trunk/Tools/ChangeLog 2012-07-17 03:51:21 UTC (rev 122803)
+++ trunk/Tools/ChangeLog 2012-07-17 04:00:50 UTC (rev 122804)
@@ -1,5 +1,27 @@
2012-07-16 Adam Barth <[email protected]>
+ [Chromium] AccessibilityController shouldn't know anything about TestShell
+ https://bugs.webkit.org/show_bug.cgi?id=91441
+
+ Reviewed by Tony Chang.
+
+ This patch is a precursor to moving AccessibilityController.cpp into TestRunner.a.
+
+ * DumpRenderTree/chromium/AccessibilityController.cpp:
+ (AccessibilityController::AccessibilityController):
+ (AccessibilityController::getFocusedElement):
+ (AccessibilityController::getRootElement):
+ * DumpRenderTree/chromium/AccessibilityController.h:
+ (WebKit):
+ (AccessibilityController):
+ (AccessibilityController::setWebView):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::initialize):
+ (TestShell::createMainWindow):
+ (TestShell::~TestShell):
+
+2012-07-16 Adam Barth <[email protected]>
+
[Chromium] Introduce TestInterfaces to hold all the _javascript_ interfaces needed for LayoutTests
https://bugs.webkit.org/show_bug.cgi?id=91312
Modified: trunk/Tools/DumpRenderTree/chromium/AccessibilityController.cpp (122803 => 122804)
--- trunk/Tools/DumpRenderTree/chromium/AccessibilityController.cpp 2012-07-17 03:51:21 UTC (rev 122803)
+++ trunk/Tools/DumpRenderTree/chromium/AccessibilityController.cpp 2012-07-17 04:00:50 UTC (rev 122804)
@@ -31,7 +31,6 @@
#include "config.h"
#include "AccessibilityController.h"
-#include "TestShell.h"
#include "WebAccessibilityObject.h"
#include "WebFrame.h"
#include "platform/WebString.h"
@@ -39,9 +38,8 @@
using namespace WebKit;
-AccessibilityController::AccessibilityController(TestShell* shell)
+AccessibilityController::AccessibilityController()
: m_logAccessibilityEvents(false)
- , m_shell(shell)
{
bindMethod("logAccessibilityEvents", &AccessibilityController::logAccessibilityEventsCallback);
@@ -77,14 +75,14 @@
AccessibilityUIElement* AccessibilityController::getFocusedElement()
{
if (m_focusedElement.isNull())
- m_focusedElement = m_shell->webView()->accessibilityObject();
+ m_focusedElement = m_webView->accessibilityObject();
return m_elements.getOrCreate(m_focusedElement);
}
AccessibilityUIElement* AccessibilityController::getRootElement()
{
if (m_rootElement.isNull())
- m_rootElement = m_shell->webView()->accessibilityObject();
+ m_rootElement = m_webView->accessibilityObject();
return m_elements.createRoot(m_rootElement);
}
Modified: trunk/Tools/DumpRenderTree/chromium/AccessibilityController.h (122803 => 122804)
--- trunk/Tools/DumpRenderTree/chromium/AccessibilityController.h 2012-07-17 03:51:21 UTC (rev 122803)
+++ trunk/Tools/DumpRenderTree/chromium/AccessibilityController.h 2012-07-17 04:00:50 UTC (rev 122804)
@@ -37,13 +37,12 @@
namespace WebKit {
class WebAccessibilityObject;
class WebFrame;
+class WebView;
}
-class TestShell;
-
class AccessibilityController : public CppBoundClass {
public:
- explicit AccessibilityController(TestShell*);
+ AccessibilityController();
// Shadow to include accessibility initialization.
void bindToJavascript(WebKit::WebFrame*, const WebKit::WebString& classname);
@@ -57,6 +56,8 @@
void notificationReceived(const WebKit::WebAccessibilityObject& target, const char* notificationName);
+ void setWebView(WebKit::WebView* webView) { m_webView = webView; }
+
private:
// If true, will log all accessibility notifications.
bool m_logAccessibilityEvents;
@@ -77,7 +78,7 @@
std::vector<CppVariant> m_notificationCallbacks;
- TestShell* m_shell;
+ WebKit::WebView* m_webView;
};
#endif // AccessibilityController_h
Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.cpp (122803 => 122804)
--- trunk/Tools/DumpRenderTree/chromium/TestShell.cpp 2012-07-17 03:51:21 UTC (rev 122803)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.cpp 2012-07-17 04:00:50 UTC (rev 122804)
@@ -146,7 +146,7 @@
void TestShell::initialize()
{
m_webPermissions = adoptPtr(new WebPermissions(this));
- m_accessibilityController = adoptPtr(new AccessibilityController(this));
+ m_accessibilityController = adoptPtr(new AccessibilityController());
m_testInterfaces = adoptPtr(new TestInterfaces());
m_layoutTestController = adoptPtr(new LayoutTestController(this));
m_eventSender = adoptPtr(new EventSender(this));
@@ -175,15 +175,13 @@
m_drtDevToolsAgent = adoptPtr(new DRTDevToolsAgent);
m_webViewHost = adoptPtr(createNewWindow(WebURL(), m_drtDevToolsAgent.get()));
m_webView = m_webViewHost->webView();
+ m_accessibilityController->setWebView(m_webView);
m_drtDevToolsAgent->setWebView(m_webView);
}
TestShell::~TestShell()
{
- // Note: DevTools are closed together with all the other windows in the
- // windows list.
-
- // Destroy the WebView before its WebViewHost.
+ m_accessibilityController->setWebView(0);
m_drtDevToolsAgent->setWebView(0);
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes