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

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

Issue 1155183006: Reimplement automation API on top of C++-backed AXTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@automation_faster_2
Patch Set: Copy observers Created 5 years, 6 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') | no next file » | 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/strings/string_number_conversions.h" 6 #include "base/strings/string_number_conversions.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/accessibility/ax_node.h" 8 #include "ui/accessibility/ax_node.h"
9 #include "ui/accessibility/ax_serializable_tree.h" 9 #include "ui/accessibility/ax_serializable_tree.h"
10 #include "ui/accessibility/ax_tree.h" 10 #include "ui/accessibility/ax_tree.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 update.nodes[0].role = AX_ROLE_ROOT_WEB_AREA; 318 update.nodes[0].role = AX_ROLE_ROOT_WEB_AREA;
319 update.nodes[0].child_ids.push_back(4); 319 update.nodes[0].child_ids.push_back(4);
320 update.nodes[1].id = 4; 320 update.nodes[1].id = 4;
321 321
322 FakeAXTreeDelegate fake_delegate; 322 FakeAXTreeDelegate fake_delegate;
323 tree.SetDelegate(&fake_delegate); 323 tree.SetDelegate(&fake_delegate);
324 324
325 EXPECT_TRUE(tree.Unserialize(update)); 325 EXPECT_TRUE(tree.Unserialize(update));
326 326
327 ASSERT_EQ(2U, fake_delegate.deleted_ids().size()); 327 ASSERT_EQ(2U, fake_delegate.deleted_ids().size());
328 EXPECT_EQ(2, fake_delegate.deleted_ids()[0]); 328 EXPECT_EQ(1, fake_delegate.deleted_ids()[0]);
329 EXPECT_EQ(1, fake_delegate.deleted_ids()[1]); 329 EXPECT_EQ(2, fake_delegate.deleted_ids()[1]);
330 330
331 ASSERT_EQ(1U, fake_delegate.subtree_deleted_ids().size()); 331 ASSERT_EQ(1U, fake_delegate.subtree_deleted_ids().size());
332 EXPECT_EQ(1, fake_delegate.subtree_deleted_ids()[0]); 332 EXPECT_EQ(1, fake_delegate.subtree_deleted_ids()[0]);
333 333
334 ASSERT_EQ(2U, fake_delegate.created_ids().size()); 334 ASSERT_EQ(2U, fake_delegate.created_ids().size());
335 EXPECT_EQ(3, fake_delegate.created_ids()[0]); 335 EXPECT_EQ(3, fake_delegate.created_ids()[0]);
336 EXPECT_EQ(4, fake_delegate.created_ids()[1]); 336 EXPECT_EQ(4, fake_delegate.created_ids()[1]);
337 337
338 ASSERT_EQ(1U, fake_delegate.subtree_creation_finished_ids().size()); 338 ASSERT_EQ(1U, fake_delegate.subtree_creation_finished_ids().size());
339 EXPECT_EQ(3, fake_delegate.subtree_creation_finished_ids()[0]); 339 EXPECT_EQ(3, fake_delegate.subtree_creation_finished_ids()[0]);
340 340
341 ASSERT_EQ(1U, fake_delegate.node_creation_finished_ids().size()); 341 ASSERT_EQ(1U, fake_delegate.node_creation_finished_ids().size());
342 EXPECT_EQ(4, fake_delegate.node_creation_finished_ids()[0]); 342 EXPECT_EQ(4, fake_delegate.node_creation_finished_ids()[0]);
343 343
344 ASSERT_EQ(true, fake_delegate.root_changed()); 344 ASSERT_EQ(true, fake_delegate.root_changed());
345 345
346 tree.SetDelegate(NULL); 346 tree.SetDelegate(NULL);
347 } 347 }
348 348
349 } // namespace ui 349 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698