OLD | NEW |
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 "ui/accessibility/ax_tree.h" | 5 #include "ui/accessibility/ax_tree.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 ASSERT_EQ(0U, fake_delegate.subtree_creation_finished_ids().size()); | 472 ASSERT_EQ(0U, fake_delegate.subtree_creation_finished_ids().size()); |
473 | 473 |
474 ASSERT_EQ(1U, fake_delegate.node_creation_finished_ids().size()); | 474 ASSERT_EQ(1U, fake_delegate.node_creation_finished_ids().size()); |
475 EXPECT_EQ(4, fake_delegate.node_creation_finished_ids()[0]); | 475 EXPECT_EQ(4, fake_delegate.node_creation_finished_ids()[0]); |
476 | 476 |
477 ASSERT_EQ(true, fake_delegate.root_changed()); | 477 ASSERT_EQ(true, fake_delegate.root_changed()); |
478 | 478 |
479 tree.SetDelegate(NULL); | 479 tree.SetDelegate(NULL); |
480 } | 480 } |
481 | 481 |
482 // UAF caught by ax_tree_fuzzer | |
483 TEST(AXTreeTest, BogusAXTree) { | |
484 AXTreeUpdate initial_state; | |
485 AXNodeData node; | |
486 node.id = 0; | |
487 node.state = 0; | |
488 initial_state.nodes.push_back(node); | |
489 initial_state.nodes.push_back(node); | |
490 ui::AXTree tree; | |
491 tree.Unserialize(initial_state); | |
492 } | |
493 | |
494 // UAF caught by ax_tree_fuzzer | |
495 TEST(AXTreeTest, BogusAXTree2) { | |
496 AXTreeUpdate initial_state; | |
497 AXNodeData node; | |
498 node.id = 0; | |
499 node.state = 0; | |
500 initial_state.nodes.push_back(node); | |
501 AXNodeData node2; | |
502 node2.id = 0; | |
503 node2.state = 0; | |
504 node2.child_ids.push_back(0); | |
505 node2.child_ids.push_back(0); | |
506 initial_state.nodes.push_back(node2); | |
507 ui::AXTree tree; | |
508 tree.Unserialize(initial_state); | |
509 } | |
510 | |
511 } // namespace ui | 482 } // namespace ui |
OLD | NEW |