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

Side by Side Diff: ui/accessibility/ax_tree_unittest.cc

Issue 1716663002: Add a treeChange type to Automation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl set_commit Created 4 years, 10 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
« no previous file with comments | « ui/accessibility/ax_tree.cc ('k') | ui/accessibility/platform/test_ax_node_wrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/accessibility/ax_node.h" 11 #include "ui/accessibility/ax_node.h"
12 #include "ui/accessibility/ax_serializable_tree.h" 12 #include "ui/accessibility/ax_serializable_tree.h"
13 #include "ui/accessibility/ax_tree.h" 13 #include "ui/accessibility/ax_tree.h"
14 #include "ui/accessibility/ax_tree_serializer.h" 14 #include "ui/accessibility/ax_tree_serializer.h"
15 15
16 namespace ui { 16 namespace ui {
17 17
18 namespace { 18 namespace {
19 19
20 class FakeAXTreeDelegate : public AXTreeDelegate { 20 class FakeAXTreeDelegate : public AXTreeDelegate {
21 public: 21 public:
22 FakeAXTreeDelegate() 22 FakeAXTreeDelegate()
23 : tree_data_changed_(false), 23 : tree_data_changed_(false),
24 root_changed_(false) {} 24 root_changed_(false) {}
25 25
26 void OnNodeDataWillChange(AXTree* tree,
27 const AXNodeData& old_node_data,
28 const AXNodeData& new_node_data) override {}
26 void OnTreeDataChanged(AXTree* tree) override { 29 void OnTreeDataChanged(AXTree* tree) override {
27 tree_data_changed_ = true; 30 tree_data_changed_ = true;
28 } 31 }
29 32
30 void OnNodeWillBeDeleted(AXTree* tree, AXNode* node) override { 33 void OnNodeWillBeDeleted(AXTree* tree, AXNode* node) override {
31 deleted_ids_.push_back(node->id()); 34 deleted_ids_.push_back(node->id());
32 } 35 }
33 36
34 void OnSubtreeWillBeDeleted(AXTree* tree, AXNode* node) override { 37 void OnSubtreeWillBeDeleted(AXTree* tree, AXNode* node) override {
35 subtree_deleted_ids_.push_back(node->id()); 38 subtree_deleted_ids_.push_back(node->id());
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 tree_data_update.has_tree_data = true; 395 tree_data_update.has_tree_data = true;
393 tree_data_update.tree_data.title = "New Title"; 396 tree_data_update.tree_data.title = "New Title";
394 EXPECT_TRUE(tree.Unserialize(tree_data_update)); 397 EXPECT_TRUE(tree.Unserialize(tree_data_update));
395 EXPECT_TRUE(fake_delegate.tree_data_changed()); 398 EXPECT_TRUE(fake_delegate.tree_data_changed());
396 EXPECT_EQ("New Title", tree.data().title); 399 EXPECT_EQ("New Title", tree.data().title);
397 400
398 tree.SetDelegate(NULL); 401 tree.SetDelegate(NULL);
399 } 402 }
400 403
401 } // namespace ui 404 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_tree.cc ('k') | ui/accessibility/platform/test_ax_node_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698