OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/browser/accessibility/browser_accessibility_cocoa.h" | 10 #include "content/browser/accessibility/browser_accessibility_cocoa.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 child2.id = 1002; | 45 child2.id = 1002; |
46 child2.location.set_x(250); | 46 child2.location.set_x(250); |
47 child2.location.set_width(250); | 47 child2.location.set_width(250); |
48 child2.location.set_height(100); | 48 child2.location.set_height(100); |
49 child2.role = ui::AX_ROLE_HEADING; | 49 child2.role = ui::AX_ROLE_HEADING; |
50 | 50 |
51 manager_.reset( | 51 manager_.reset( |
52 new BrowserAccessibilityManagerMac( | 52 new BrowserAccessibilityManagerMac( |
53 nil, | 53 nil, |
54 MakeAXTreeUpdate(root, child1, child2), | 54 MakeAXTreeUpdate(root, child1, child2), |
55 NULL)); | 55 nullptr)); |
56 accessibility_.reset([manager_->GetRoot()->ToBrowserAccessibilityCocoa() | 56 accessibility_.reset([manager_->GetRoot()->ToBrowserAccessibilityCocoa() |
57 retain]); | 57 retain]); |
58 } | 58 } |
59 | 59 |
60 base::scoped_nsobject<BrowserAccessibilityCocoa> accessibility_; | 60 base::scoped_nsobject<BrowserAccessibilityCocoa> accessibility_; |
61 scoped_ptr<BrowserAccessibilityManager> manager_; | 61 scoped_ptr<BrowserAccessibilityManager> manager_; |
62 }; | 62 }; |
63 | 63 |
64 // Standard hit test. | 64 // Standard hit test. |
65 TEST_F(BrowserAccessibilityTest, HitTestTest) { | 65 TEST_F(BrowserAccessibilityTest, HitTestTest) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 // Now any attributes we query should return nil. | 117 // Now any attributes we query should return nil. |
118 EXPECT_EQ(nil, [retainedFirstChild | 118 EXPECT_EQ(nil, [retainedFirstChild |
119 accessibilityAttributeValue:NSAccessibilityTitleAttribute]); | 119 accessibilityAttributeValue:NSAccessibilityTitleAttribute]); |
120 | 120 |
121 // Don't leak memory in the test. | 121 // Don't leak memory in the test. |
122 [retainedFirstChild release]; | 122 [retainedFirstChild release]; |
123 } | 123 } |
124 | 124 |
125 } // namespace content | 125 } // namespace content |
OLD | NEW |