Commit fef4b7c4 authored by sungmann.cho's avatar sungmann.cho Committed by Commit bot

Refactor RendererAccessibiltiyComplete back into RendererAccessibility.

After landing of https://codereview.chromium.org/651593002,
the inheritance relationship between RendererAccessibility and
RendererAccessibiltiyComplete is not necessary anymore.
So we can make them one class.

BUG=417758

Review URL: https://codereview.chromium.org/688173002

Cr-Commit-Position: refs/heads/master@{#302197}
parent f0ce5723
...@@ -82,8 +82,6 @@ ...@@ -82,8 +82,6 @@
'renderer/accessibility/blink_ax_tree_source.h', 'renderer/accessibility/blink_ax_tree_source.h',
'renderer/accessibility/renderer_accessibility.cc', 'renderer/accessibility/renderer_accessibility.cc',
'renderer/accessibility/renderer_accessibility.h', 'renderer/accessibility/renderer_accessibility.h',
'renderer/accessibility/renderer_accessibility_complete.cc',
'renderer/accessibility/renderer_accessibility_complete.h',
'renderer/active_notification_tracker.cc', 'renderer/active_notification_tracker.cc',
'renderer/active_notification_tracker.h', 'renderer/active_notification_tracker.h',
'renderer/android/address_detector.cc', 'renderer/android/address_detector.cc',
......
...@@ -5,74 +5,122 @@ ...@@ -5,74 +5,122 @@
#ifndef CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_ #ifndef CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_
#define CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_ #define CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_
#include <vector>
#include "base/containers/hash_tables.h"
#include "base/memory/weak_ptr.h"
#include "content/common/accessibility_messages.h" #include "content/common/accessibility_messages.h"
#include "content/public/renderer/render_frame_observer.h" #include "content/public/renderer/render_frame_observer.h"
#include "content/renderer/accessibility/blink_ax_tree_source.h"
#include "third_party/WebKit/public/web/WebAXObject.h" #include "third_party/WebKit/public/web/WebAXObject.h"
#include "ui/accessibility/ax_tree_serializer.h"
namespace blink { namespace blink {
class WebDocument; class WebDocument;
class WebNode;
}; };
namespace content { namespace content {
class RenderFrameImpl; class RenderFrameImpl;
enum RendererAccessibilityType { // The browser process implements native accessibility APIs, allowing
// Turns on Blink accessibility and provides a full accessibility
// implementation for when assistive technology is running.
RendererAccessibilityTypeComplete
};
// The browser process implement native accessibility APIs, allowing
// assistive technology (e.g., screen readers, magnifiers) to access and // assistive technology (e.g., screen readers, magnifiers) to access and
// control the web contents with high-level APIs. These APIs are also used // control the web contents with high-level APIs. These APIs are also used
// by automation tools, and Windows 8 uses them to determine when the // by automation tools, and Windows 8 uses them to determine when the
// on-screen keyboard should be shown. // on-screen keyboard should be shown.
// //
// An instance of this class (or rather, a subclass) belongs to RenderFrameImpl. // An instance of this class belongs to RenderFrameImpl. Accessibility is
// Accessibility is initialized based on the AccessibilityMode of // initialized based on the AccessibilityMode of RenderFrameImpl; it lazily
// RenderFrameImpl; it lazily starts as Off or EditableTextOnly depending on // starts as Off or EditableTextOnly depending on the operating system, and
// the operating system, and switches to Complete if assistive technology is // switches to Complete if assistive technology is detected or a flag is set.
// detected or a flag is set.
// //
// A tree of accessible objects is built here and sent to the browser process; // A tree of accessible objects is built here and sent to the browser process;
// the browser process maintains this as a tree of platform-native // the browser process maintains this as a tree of platform-native
// accessible objects that can be used to respond to accessibility requests // accessible objects that can be used to respond to accessibility requests
// from other processes. // from other processes.
// //
// This base class just contains common code and will not do anything by itself. // This class implements complete accessibility support for assistive
// The subclass is: // technology. It turns on Blink's accessibility code and sends a serialized
// // representation of that tree whenever it changes. It also handles requests
// RendererAccessibilityComplete - turns on Blink accessibility and // from the browser to perform accessibility actions on nodes in the tree
// provides a full accessibility implementation for when // (e.g., change focus, or click on a button).
// assistive technology is running.
//
class CONTENT_EXPORT RendererAccessibility : public RenderFrameObserver { class CONTENT_EXPORT RendererAccessibility : public RenderFrameObserver {
public: public:
explicit RendererAccessibility(RenderFrameImpl* render_frame); explicit RendererAccessibility(RenderFrameImpl* render_frame);
~RendererAccessibility() override; ~RendererAccessibility() override;
// RenderFrameObserver implementation.
bool OnMessageReceived(const IPC::Message& message) override;
// Called when an accessibility notification occurs in Blink. // Called when an accessibility notification occurs in Blink.
virtual void HandleWebAccessibilityEvent( void HandleWebAccessibilityEvent(const blink::WebAXObject& obj,
const blink::WebAXObject& obj, blink::WebAXEvent event) = 0; blink::WebAXEvent event);
virtual void FocusedNodeChanged(const blink::WebNode& node) = 0;
// Gets the type of this RendererAccessibility object. Primarily intended for void FocusedNodeChanged(const blink::WebNode& node);
// testing.
virtual RendererAccessibilityType GetType() = 0;
// This can be called before deleting a RendererAccessibility instance due // This can be called before deleting a RendererAccessibility instance due
// to the accessibility mode changing, as opposed to during frame destruction // to the accessibility mode changing, as opposed to during frame destruction
// (when there'd be no point). // (when there'd be no point).
virtual void DisableAccessibility() {} void DisableAccessibility();
void HandleAXEvent(const blink::WebAXObject& obj, ui::AXEvent event);
protected: protected:
// Returns the main top-level document for this page, or NULL if there's // Returns the main top-level document for this page, or NULL if there's
// no view or frame. // no view or frame.
blink::WebDocument GetMainDocument(); blink::WebDocument GetMainDocument();
// Send queued events from the renderer to the browser.
void SendPendingAccessibilityEvents();
// Check the entire accessibility tree to see if any nodes have
// changed location, by comparing their locations to the cached
// versions. If any have moved, send an IPC with the new locations.
void SendLocationChanges();
// The RenderFrameImpl that owns us. // The RenderFrameImpl that owns us.
RenderFrameImpl* render_frame_; RenderFrameImpl* render_frame_;
private:
// Handlers for messages from the browser to the renderer.
void OnDoDefaultAction(int acc_obj_id);
void OnEventsAck();
void OnFatalError();
void OnHitTest(gfx::Point point);
void OnReset(int reset_token);
void OnScrollToMakeVisible(int acc_obj_id, gfx::Rect subfocus);
void OnScrollToPoint(int acc_obj_id, gfx::Point point);
void OnSetFocus(int acc_obj_id);
void OnSetTextSelection(int acc_obj_id, int start_offset, int end_offset);
// Events from Blink are collected until they are ready to be
// sent to the browser.
std::vector<AccessibilityHostMsg_EventParams> pending_events_;
// The adapter that exposes Blink's accessibility tree to AXTreeSerializer.
BlinkAXTreeSource tree_source_;
// The serializer that sends accessibility messages to the browser process.
ui::AXTreeSerializer<blink::WebAXObject> serializer_;
// Current location of every object, so we can detect when it moves.
base::hash_map<int, gfx::Rect> locations_;
// The most recently observed scroll offset of the root document element.
// TODO(dmazzoni): remove once https://bugs.webkit.org/show_bug.cgi?id=73460
// is fixed.
gfx::Size last_scroll_offset_;
// Set if we are waiting for an accessibility event ack.
bool ack_pending_;
// Nonzero if the browser requested we reset the accessibility state.
// We need to return this token in the next IPC.
int reset_token_;
// So we can queue up tasks to be executed later.
base::WeakPtrFactory<RendererAccessibility> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RendererAccessibility); DISALLOW_COPY_AND_ASSIGN(RendererAccessibility);
}; };
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "content/common/frame_messages.h" #include "content/common/frame_messages.h"
#include "content/common/view_message_enums.h" #include "content/common/view_message_enums.h"
#include "content/public/test/render_view_test.h" #include "content/public/test/render_view_test.h"
#include "content/renderer/accessibility/renderer_accessibility_complete.h" #include "content/renderer/accessibility/renderer_accessibility.h"
#include "content/renderer/render_frame_impl.h" #include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_view_impl.h" #include "content/renderer/render_view_impl.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -22,14 +22,14 @@ using blink::WebDocument; ...@@ -22,14 +22,14 @@ using blink::WebDocument;
namespace content { namespace content {
class TestRendererAccessibilityComplete : public RendererAccessibilityComplete { class TestRendererAccessibility : public RendererAccessibility {
public: public:
explicit TestRendererAccessibilityComplete(RenderFrameImpl* render_frame) explicit TestRendererAccessibility(RenderFrameImpl* render_frame)
: RendererAccessibilityComplete(render_frame) { : RendererAccessibility(render_frame) {
} }
void SendPendingAccessibilityEvents() { void SendPendingAccessibilityEvents() {
RendererAccessibilityComplete::SendPendingAccessibilityEvents(); RendererAccessibility::SendPendingAccessibilityEvents();
} }
}; };
...@@ -79,7 +79,7 @@ class RendererAccessibilityTest : public RenderViewTest { ...@@ -79,7 +79,7 @@ class RendererAccessibilityTest : public RenderViewTest {
}; };
TEST_F(RendererAccessibilityTest, SendFullAccessibilityTreeOnReload) { TEST_F(RendererAccessibilityTest, SendFullAccessibilityTreeOnReload) {
// The job of RendererAccessibilityComplete is to serialize the // The job of RendererAccessibility is to serialize the
// accessibility tree built by WebKit and send it to the browser. // accessibility tree built by WebKit and send it to the browser.
// When the accessibility tree changes, it tries to send only // When the accessibility tree changes, it tries to send only
// the nodes that actually changed or were reparented. This test // the nodes that actually changed or were reparented. This test
...@@ -94,10 +94,9 @@ TEST_F(RendererAccessibilityTest, SendFullAccessibilityTreeOnReload) { ...@@ -94,10 +94,9 @@ TEST_F(RendererAccessibilityTest, SendFullAccessibilityTreeOnReload) {
"</body>"; "</body>";
LoadHTML(html.c_str()); LoadHTML(html.c_str());
// Creating a RendererAccessibilityComplete should sent the tree // Creating a RendererAccessibility should sent the tree to the browser.
// to the browser. scoped_ptr<TestRendererAccessibility> accessibility(
scoped_ptr<TestRendererAccessibilityComplete> accessibility( new TestRendererAccessibility(frame()));
new TestRendererAccessibilityComplete(frame()));
accessibility->SendPendingAccessibilityEvents(); accessibility->SendPendingAccessibilityEvents();
EXPECT_EQ(4, CountAccessibilityNodesSentToBrowser()); EXPECT_EQ(4, CountAccessibilityNodesSentToBrowser());
...@@ -164,10 +163,9 @@ TEST_F(RendererAccessibilityTest, ...@@ -164,10 +163,9 @@ TEST_F(RendererAccessibilityTest,
LoadHTML(html.c_str()); LoadHTML(html.c_str());
static const int kProxyRoutingId = 13; static const int kProxyRoutingId = 13;
// Creating a RendererAccessibilityComplete should send the tree // Creating a RendererAccessibility should send the tree to the browser.
// to the browser. scoped_ptr<TestRendererAccessibility> accessibility(
scoped_ptr<TestRendererAccessibilityComplete> accessibility( new TestRendererAccessibility(frame()));
new TestRendererAccessibilityComplete(frame()));
accessibility->SendPendingAccessibilityEvents(); accessibility->SendPendingAccessibilityEvents();
EXPECT_EQ(5, CountAccessibilityNodesSentToBrowser()); EXPECT_EQ(5, CountAccessibilityNodesSentToBrowser());
...@@ -207,7 +205,7 @@ TEST_F(RendererAccessibilityTest, ...@@ -207,7 +205,7 @@ TEST_F(RendererAccessibilityTest,
} }
TEST_F(RendererAccessibilityTest, HideAccessibilityObject) { TEST_F(RendererAccessibilityTest, HideAccessibilityObject) {
// Test RendererAccessibilityComplete and make sure it sends the // Test RendererAccessibility and make sure it sends the
// proper event to the browser when an object in the tree // proper event to the browser when an object in the tree
// is hidden, but its children are not. // is hidden, but its children are not.
std::string html = std::string html =
...@@ -221,8 +219,8 @@ TEST_F(RendererAccessibilityTest, HideAccessibilityObject) { ...@@ -221,8 +219,8 @@ TEST_F(RendererAccessibilityTest, HideAccessibilityObject) {
"</body>"; "</body>";
LoadHTML(html.c_str()); LoadHTML(html.c_str());
scoped_ptr<TestRendererAccessibilityComplete> accessibility( scoped_ptr<TestRendererAccessibility> accessibility(
new TestRendererAccessibilityComplete(frame())); new TestRendererAccessibility(frame()));
accessibility->SendPendingAccessibilityEvents(); accessibility->SendPendingAccessibilityEvents();
EXPECT_EQ(4, CountAccessibilityNodesSentToBrowser()); EXPECT_EQ(4, CountAccessibilityNodesSentToBrowser());
...@@ -249,7 +247,7 @@ TEST_F(RendererAccessibilityTest, HideAccessibilityObject) { ...@@ -249,7 +247,7 @@ TEST_F(RendererAccessibilityTest, HideAccessibilityObject) {
GetLastAccEvent(&event); GetLastAccEvent(&event);
ASSERT_EQ(2U, event.update.nodes.size()); ASSERT_EQ(2U, event.update.nodes.size());
// RendererAccessibilityComplete notices that 'C' is being reparented, // RendererAccessibility notices that 'C' is being reparented,
// so it clears the subtree rooted at 'A', then updates 'A' and then 'C'. // so it clears the subtree rooted at 'A', then updates 'A' and then 'C'.
EXPECT_EQ(node_a.axID(), event.update.node_id_to_clear); EXPECT_EQ(node_a.axID(), event.update.node_id_to_clear);
EXPECT_EQ(node_a.axID(), event.update.nodes[0].id); EXPECT_EQ(node_a.axID(), event.update.nodes[0].id);
...@@ -258,7 +256,7 @@ TEST_F(RendererAccessibilityTest, HideAccessibilityObject) { ...@@ -258,7 +256,7 @@ TEST_F(RendererAccessibilityTest, HideAccessibilityObject) {
} }
TEST_F(RendererAccessibilityTest, ShowAccessibilityObject) { TEST_F(RendererAccessibilityTest, ShowAccessibilityObject) {
// Test RendererAccessibilityComplete and make sure it sends the // Test RendererAccessibility and make sure it sends the
// proper event to the browser when an object in the tree // proper event to the browser when an object in the tree
// is shown, causing its own already-visible children to be // is shown, causing its own already-visible children to be
// reparented to it. // reparented to it.
...@@ -273,8 +271,8 @@ TEST_F(RendererAccessibilityTest, ShowAccessibilityObject) { ...@@ -273,8 +271,8 @@ TEST_F(RendererAccessibilityTest, ShowAccessibilityObject) {
"</body>"; "</body>";
LoadHTML(html.c_str()); LoadHTML(html.c_str());
scoped_ptr<TestRendererAccessibilityComplete> accessibility( scoped_ptr<TestRendererAccessibility> accessibility(
new TestRendererAccessibilityComplete(frame())); new TestRendererAccessibility(frame()));
accessibility->SendPendingAccessibilityEvents(); accessibility->SendPendingAccessibilityEvents();
EXPECT_EQ(3, CountAccessibilityNodesSentToBrowser()); EXPECT_EQ(3, CountAccessibilityNodesSentToBrowser());
...@@ -307,7 +305,7 @@ TEST_F(RendererAccessibilityTest, ShowAccessibilityObject) { ...@@ -307,7 +305,7 @@ TEST_F(RendererAccessibilityTest, ShowAccessibilityObject) {
} }
TEST_F(RendererAccessibilityTest, DetachAccessibilityObject) { TEST_F(RendererAccessibilityTest, DetachAccessibilityObject) {
// Test RendererAccessibilityComplete and make sure it sends the // Test RendererAccessibility and make sure it sends the
// proper event to the browser when an object in the tree // proper event to the browser when an object in the tree
// is detached, but its children are not. This can happen when // is detached, but its children are not. This can happen when
// a layout occurs and an anonymous render block is no longer needed. // a layout occurs and an anonymous render block is no longer needed.
...@@ -317,8 +315,8 @@ TEST_F(RendererAccessibilityTest, DetachAccessibilityObject) { ...@@ -317,8 +315,8 @@ TEST_F(RendererAccessibilityTest, DetachAccessibilityObject) {
"</body>"; "</body>";
LoadHTML(html.c_str()); LoadHTML(html.c_str());
scoped_ptr<TestRendererAccessibilityComplete> accessibility( scoped_ptr<TestRendererAccessibility> accessibility(
new TestRendererAccessibilityComplete(frame())); new TestRendererAccessibility(frame()));
accessibility->SendPendingAccessibilityEvents(); accessibility->SendPendingAccessibilityEvents();
EXPECT_EQ(7, CountAccessibilityNodesSentToBrowser()); EXPECT_EQ(7, CountAccessibilityNodesSentToBrowser());
...@@ -378,15 +376,15 @@ TEST_F(RendererAccessibilityTest, DetachAccessibilityObject) { ...@@ -378,15 +376,15 @@ TEST_F(RendererAccessibilityTest, DetachAccessibilityObject) {
} }
TEST_F(RendererAccessibilityTest, EventOnObjectNotInTree) { TEST_F(RendererAccessibilityTest, EventOnObjectNotInTree) {
// Test RendererAccessibilityComplete and make sure it doesn't send anything // Test RendererAccessibility and make sure it doesn't send anything
// if we get a notification from Blink for an object that isn't in the // if we get a notification from Blink for an object that isn't in the
// tree, like the scroll area that's the parent of the main document, // tree, like the scroll area that's the parent of the main document,
// which we don't expose. // which we don't expose.
std::string html = "<body><input></body>"; std::string html = "<body><input></body>";
LoadHTML(html.c_str()); LoadHTML(html.c_str());
scoped_ptr<TestRendererAccessibilityComplete> accessibility( scoped_ptr<TestRendererAccessibility> accessibility(
new TestRendererAccessibilityComplete(frame())); new TestRendererAccessibility(frame()));
accessibility->SendPendingAccessibilityEvents(); accessibility->SendPendingAccessibilityEvents();
EXPECT_EQ(3, CountAccessibilityNodesSentToBrowser()); EXPECT_EQ(3, CountAccessibilityNodesSentToBrowser());
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_COMPLETE_H_
#define CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_COMPLETE_H_
#include <set>
#include <vector>
#include "base/containers/hash_tables.h"
#include "base/memory/weak_ptr.h"
#include "content/public/renderer/render_view_observer.h"
#include "content/renderer/accessibility/blink_ax_tree_source.h"
#include "content/renderer/accessibility/renderer_accessibility.h"
#include "third_party/WebKit/public/web/WebAXEnums.h"
#include "third_party/WebKit/public/web/WebAXObject.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_tree_serializer.h"
namespace blink {
class WebDocument;
class WebNode;
};
namespace content {
class RenderViewImpl;
// This is the subclass of RendererAccessibility that implements
// complete accessibility support for assistive technology.
//
// This version turns on Blink's accessibility code and sends
// a serialized representation of that tree whenever it changes. It also
// handles requests from the browser to perform accessibility actions on
// nodes in the tree (e.g., change focus, or click on a button).
class CONTENT_EXPORT RendererAccessibilityComplete
: public RendererAccessibility {
public:
explicit RendererAccessibilityComplete(RenderFrameImpl* render_frame);
~RendererAccessibilityComplete() override;
// RenderFrameObserver implementation.
bool OnMessageReceived(const IPC::Message& message) override;
// RendererAccessibility.
void HandleWebAccessibilityEvent(const blink::WebAXObject& obj,
blink::WebAXEvent event) override;
RendererAccessibilityType GetType() override;
void FocusedNodeChanged(const blink::WebNode& node) override;
void DisableAccessibility() override;
void HandleAXEvent(const blink::WebAXObject& obj, ui::AXEvent event);
protected:
// Send queued events from the renderer to the browser.
void SendPendingAccessibilityEvents();
// Check the entire accessibility tree to see if any nodes have
// changed location, by comparing their locations to the cached
// versions. If any have moved, send an IPC with the new locations.
void SendLocationChanges();
private:
// Handlers for messages from the browser to the renderer.
void OnDoDefaultAction(int acc_obj_id);
void OnEventsAck();
void OnChangeScrollPosition(int acc_obj_id, int scroll_x, int scroll_y);
void OnScrollToMakeVisible(int acc_obj_id, gfx::Rect subfocus);
void OnScrollToPoint(int acc_obj_id, gfx::Point point);
void OnSetFocus(int acc_obj_id);
void OnSetTextSelection(int acc_obj_id, int start_offset, int end_offset);
void OnHitTest(gfx::Point point);
void OnReset(int reset_token);
void OnFatalError();
// Events from Blink are collected until they are ready to be
// sent to the browser.
std::vector<AccessibilityHostMsg_EventParams> pending_events_;
// The adapter that exposes Blink's accessibility tree to AXTreeSerializer.
BlinkAXTreeSource tree_source_;
// The serializer that sends accessibility messages to the browser process.
ui::AXTreeSerializer<blink::WebAXObject> serializer_;
// Current location of every object, so we can detect when it moves.
base::hash_map<int, gfx::Rect> locations_;
// The most recently observed scroll offset of the root document element.
// TODO(dmazzoni): remove once https://bugs.webkit.org/show_bug.cgi?id=73460
// is fixed.
gfx::Size last_scroll_offset_;
// Set if we are waiting for an accessibility event ack.
bool ack_pending_;
// Nonzero if the browser requested we reset the accessibility state.
// We need to return this token in the next IPC.
int reset_token_;
// So we can queue up tasks to be executed later.
base::WeakPtrFactory<RendererAccessibilityComplete> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RendererAccessibilityComplete);
};
#endif // CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_COMPLETE_H_
} // namespace content
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include "content/public/renderer/document_state.h" #include "content/public/renderer/document_state.h"
#include "content/public/renderer/navigation_state.h" #include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_frame_observer.h" #include "content/public/renderer/render_frame_observer.h"
#include "content/renderer/accessibility/renderer_accessibility_complete.h" #include "content/renderer/accessibility/renderer_accessibility.h"
#include "content/renderer/browser_plugin/browser_plugin.h" #include "content/renderer/browser_plugin/browser_plugin.h"
#include "content/renderer/browser_plugin/browser_plugin_manager.h" #include "content/renderer/browser_plugin/browser_plugin_manager.h"
#include "content/renderer/child_frame_compositing_helper.h" #include "content/renderer/child_frame_compositing_helper.h"
...@@ -1387,7 +1387,7 @@ void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { ...@@ -1387,7 +1387,7 @@ void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) {
return; return;
if (accessibility_mode_ & AccessibilityModeFlagFullTree) if (accessibility_mode_ & AccessibilityModeFlagFullTree)
renderer_accessibility_ = new RendererAccessibilityComplete(this); renderer_accessibility_ = new RendererAccessibility(this);
} }
void RenderFrameImpl::OnDisownOpener() { void RenderFrameImpl::OnDisownOpener() {
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "content/public/test/render_view_test.h" #include "content/public/test/render_view_test.h"
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
#include "content/renderer/accessibility/renderer_accessibility.h" #include "content/renderer/accessibility/renderer_accessibility.h"
#include "content/renderer/accessibility/renderer_accessibility_complete.h"
#include "content/renderer/history_controller.h" #include "content/renderer/history_controller.h"
#include "content/renderer/history_serialization.h" #include "content/renderer/history_serialization.h"
#include "content/renderer/render_process.h" #include "content/renderer/render_process.h"
...@@ -2406,8 +2405,6 @@ TEST_F(RenderViewImplTest, OnSetAccessibilityMode) { ...@@ -2406,8 +2405,6 @@ TEST_F(RenderViewImplTest, OnSetAccessibilityMode) {
frame()->OnSetAccessibilityMode(AccessibilityModeTreeOnly); frame()->OnSetAccessibilityMode(AccessibilityModeTreeOnly);
ASSERT_EQ(AccessibilityModeTreeOnly, frame()->accessibility_mode()); ASSERT_EQ(AccessibilityModeTreeOnly, frame()->accessibility_mode());
ASSERT_NE((RendererAccessibility*) NULL, frame()->renderer_accessibility()); ASSERT_NE((RendererAccessibility*) NULL, frame()->renderer_accessibility());
ASSERT_EQ(RendererAccessibilityTypeComplete,
frame()->renderer_accessibility()->GetType());
frame()->OnSetAccessibilityMode(AccessibilityModeOff); frame()->OnSetAccessibilityMode(AccessibilityModeOff);
ASSERT_EQ(AccessibilityModeOff, frame()->accessibility_mode()); ASSERT_EQ(AccessibilityModeOff, frame()->accessibility_mode());
...@@ -2416,8 +2413,6 @@ TEST_F(RenderViewImplTest, OnSetAccessibilityMode) { ...@@ -2416,8 +2413,6 @@ TEST_F(RenderViewImplTest, OnSetAccessibilityMode) {
frame()->OnSetAccessibilityMode(AccessibilityModeComplete); frame()->OnSetAccessibilityMode(AccessibilityModeComplete);
ASSERT_EQ(AccessibilityModeComplete, frame()->accessibility_mode()); ASSERT_EQ(AccessibilityModeComplete, frame()->accessibility_mode());
ASSERT_NE((RendererAccessibility*) NULL, frame()->renderer_accessibility()); ASSERT_NE((RendererAccessibility*) NULL, frame()->renderer_accessibility());
ASSERT_EQ(RendererAccessibilityTypeComplete,
frame()->renderer_accessibility()->GetType());
} }
TEST_F(RenderViewImplTest, ScreenMetricsEmulation) { TEST_F(RenderViewImplTest, ScreenMetricsEmulation) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment