Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Side by Side Diff: content/browser/accessibility/dump_accessibility_tree_helper_win.cc

Issue 11823026: Adding some new DumpAccessibilityTree tests, tweaking DumpAccessibilityTree helpers and fixing a bug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix valueNow -> currentValue Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "content/browser/accessibility/dump_accessibility_tree_helper.h" 5 #include "content/browser/accessibility/dump_accessibility_tree_helper.h"
6 6
7 #include <oleacc.h> 7 #include <oleacc.h>
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/stringprintf.h"
13 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
14 #include "content/browser/accessibility/browser_accessibility_win.h" 15 #include "content/browser/accessibility/browser_accessibility_win.h"
15 #include "content/common/accessibility_node_data.h" 16 #include "content/common/accessibility_node_data.h"
16 #include "content/public/test/accessibility_test_utils_win.h" 17 #include "content/public/test/accessibility_test_utils_win.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 #include "third_party/iaccessible2/ia2_api_all.h" 19 #include "third_party/iaccessible2/ia2_api_all.h"
19 #include "ui/base/win/atl_module.h" 20 #include "ui/base/win/atl_module.h"
20 21
21 namespace content { 22 namespace content {
22 23
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 it != state_strings.end(); 60 it != state_strings.end();
60 ++it) { 61 ++it) {
61 Add(false, *it); 62 Add(false, *it);
62 } 63 }
63 for (std::vector<string16>::const_iterator it = ia2_attributes.begin(); 64 for (std::vector<string16>::const_iterator it = ia2_attributes.begin();
64 it != ia2_attributes.end(); 65 it != ia2_attributes.end();
65 ++it) { 66 ++it) {
66 Add(false, *it); 67 Add(false, *it);
67 } 68 }
68 Add(false, L"role_name='" + acc_obj->role_name() + L"'"); 69 Add(false, L"role_name='" + acc_obj->role_name() + L"'");
69 Add(false, L"value='" + acc_obj->value() + L"'"); 70 VARIANT currentValue;
71 if (acc_obj->get_currentValue(&currentValue) != S_FALSE)
72 Add(false, StringPrintf(L"currentValue=%.2f", V_R8(&currentValue)));
73 VARIANT minimumValue;
74 if (acc_obj->get_minimumValue(&minimumValue) != S_FALSE)
75 Add(false, StringPrintf(L"minimumValue=%.2f", V_R8(&minimumValue)));
76 VARIANT maximumValue;
77 if (acc_obj->get_maximumValue(&maximumValue) != S_FALSE)
78 Add(false, StringPrintf(L"maximumValue=%.2f", V_R8(&maximumValue)));
70 Add(false, L"description='" + description + L"'"); 79 Add(false, L"description='" + description + L"'");
71 return UTF8ToUTF16(prefix) + FinishLine() + ASCIIToUTF16("\n"); 80 return UTF8ToUTF16(prefix) + FinishLine() + ASCIIToUTF16("\n");
72 } 81 }
73 82
74 const FilePath::StringType DumpAccessibilityTreeHelper::GetActualFileSuffix() 83 const FilePath::StringType DumpAccessibilityTreeHelper::GetActualFileSuffix()
75 const { 84 const {
76 return FILE_PATH_LITERAL("-actual-win.txt"); 85 return FILE_PATH_LITERAL("-actual-win.txt");
77 } 86 }
78 87
79 const FilePath::StringType DumpAccessibilityTreeHelper::GetExpectedFileSuffix() 88 const FilePath::StringType DumpAccessibilityTreeHelper::GetExpectedFileSuffix()
80 const { 89 const {
81 return FILE_PATH_LITERAL("-expected-win.txt"); 90 return FILE_PATH_LITERAL("-expected-win.txt");
82 } 91 }
83 92
84 93
85 const std::string DumpAccessibilityTreeHelper::GetAllowString() const { 94 const std::string DumpAccessibilityTreeHelper::GetAllowString() const {
86 return "@WIN-ALLOW:"; 95 return "@WIN-ALLOW:";
87 } 96 }
88 97
89 const std::string DumpAccessibilityTreeHelper::GetDenyString() const { 98 const std::string DumpAccessibilityTreeHelper::GetDenyString() const {
90 return "@WIN-DENY:"; 99 return "@WIN-DENY:";
91 } 100 }
92 101
93 } // namespace content 102 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/dump_accessibility_tree_helper_mac.mm ('k') | content/renderer/accessibility_node_serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698