OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/test_runner/web_ax_object_proxy.h" | 5 #include "components/test_runner/web_ax_object_proxy.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "gin/handle.h" | 11 #include "gin/handle.h" |
12 #include "third_party/WebKit/public/platform/WebPoint.h" | 12 #include "third_party/WebKit/public/platform/WebPoint.h" |
13 #include "third_party/WebKit/public/platform/WebRect.h" | 13 #include "third_party/WebKit/public/platform/WebRect.h" |
14 #include "third_party/WebKit/public/platform/WebString.h" | 14 #include "third_party/WebKit/public/platform/WebString.h" |
15 #include "third_party/WebKit/public/web/WebFrame.h" | 15 #include "third_party/WebKit/public/web/WebFrame.h" |
16 #include "third_party/WebKit/public/web/WebKit.h" | 16 #include "third_party/WebKit/public/web/WebKit.h" |
17 | 17 |
18 namespace test_runner { | 18 namespace test_runner { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // Map role value to string, matching Safari/Mac platform implementation to | 22 // Map role value to string, matching Safari/Mac platform implementation to |
23 // avoid rebaselining layout tests. | 23 // avoid rebaselining layout tests. |
24 std::string RoleToString(blink::WebAXRole role) | 24 std::string RoleToString(blink::WebAXRole role) |
25 { | 25 { |
26 std::string result = "AXRole: AX"; | 26 std::string result = "AXRole: AX"; |
27 switch (role) { | 27 switch (role) { |
| 28 case blink::WebAXRoleAbbr: |
| 29 return result.append("Abbr"); |
28 case blink::WebAXRoleAlertDialog: | 30 case blink::WebAXRoleAlertDialog: |
29 return result.append("AlertDialog"); | 31 return result.append("AlertDialog"); |
30 case blink::WebAXRoleAlert: | 32 case blink::WebAXRoleAlert: |
31 return result.append("Alert"); | 33 return result.append("Alert"); |
32 case blink::WebAXRoleAnnotation: | 34 case blink::WebAXRoleAnnotation: |
33 return result.append("Annotation"); | 35 return result.append("Annotation"); |
34 case blink::WebAXRoleApplication: | 36 case blink::WebAXRoleApplication: |
35 return result.append("Application"); | 37 return result.append("Application"); |
36 case blink::WebAXRoleArticle: | 38 case blink::WebAXRoleArticle: |
37 return result.append("Article"); | 39 return result.append("Article"); |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1476 v8::Local<v8::Value> value_handle = gin::CreateHandle( | 1478 v8::Local<v8::Value> value_handle = gin::CreateHandle( |
1477 isolate, new WebAXObjectProxy(object, this)).ToV8(); | 1479 isolate, new WebAXObjectProxy(object, this)).ToV8(); |
1478 if (value_handle.IsEmpty()) | 1480 if (value_handle.IsEmpty()) |
1479 return v8::Local<v8::Object>(); | 1481 return v8::Local<v8::Object>(); |
1480 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); | 1482 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); |
1481 elements_.Append(handle); | 1483 elements_.Append(handle); |
1482 return handle; | 1484 return handle; |
1483 } | 1485 } |
1484 | 1486 |
1485 } // namespace test_runner | 1487 } // namespace test_runner |
OLD | NEW |