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

Side by Side Diff: chrome/browser/extensions/api/automation/automation_apitest.cc

Issue 967583002: Improve AXTree unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update automation_apitest.cc Created 5 years, 9 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 | « no previous file | ui/accessibility/ax_generated_tree_unittest.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 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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "chrome/browser/extensions/api/automation_internal/automation_util.h" 8 #include "chrome/browser/extensions/api/automation_internal/automation_util.h"
9 #include "chrome/browser/extensions/chrome_extension_function.h" 9 #include "chrome/browser/extensions/chrome_extension_function.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // test extension respectively: see 224 // test extension respectively: see
225 // c/t/data/extensions/api_test/automation/tests/generated/generated_trees.js 225 // c/t/data/extensions/api_test/automation/tests/generated/generated_trees.js
226 class TreeSerializationState { 226 class TreeSerializationState {
227 public: 227 public:
228 TreeSerializationState() 228 TreeSerializationState()
229 #ifdef NDEBUG 229 #ifdef NDEBUG
230 : tree_size(3), 230 : tree_size(3),
231 #else 231 #else
232 : tree_size(2), 232 : tree_size(2),
233 #endif 233 #endif
234 generator(tree_size), 234 generator(tree_size, true),
235 num_trees(generator.UniqueTreeCount()), 235 num_trees(generator.UniqueTreeCount()),
236 tree0_version(0), 236 tree0_version(0),
237 tree1_version(0) { 237 tree1_version(0) {
238 } 238 }
239 239
240 // Serializes tree and sends it as an accessibility event to the extension. 240 // Serializes tree and sends it as an accessibility event to the extension.
241 void SendDataForTree(const ui::AXTree* tree, 241 void SendDataForTree(const ui::AXTree* tree,
242 TreeSerializer* serializer, 242 TreeSerializer* serializer,
243 int routing_id, 243 int routing_id,
244 BrowserContext* browser_context) { 244 BrowserContext* browser_context) {
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 "automationInternal.enableTab", 518 "automationInternal.enableTab",
519 FakeAutomationInternalEnableTabFunctionFactory)); 519 FakeAutomationInternalEnableTabFunctionFactory));
520 ASSERT_TRUE(extensions::ExtensionFunctionDispatcher::OverrideFunction( 520 ASSERT_TRUE(extensions::ExtensionFunctionDispatcher::OverrideFunction(
521 "automationInternal.performAction", 521 "automationInternal.performAction",
522 FakeAutomationInternalPerformActionFunctionFactory)); 522 FakeAutomationInternalPerformActionFunctionFactory));
523 ASSERT_TRUE(RunExtensionSubtest("automation/tests/generated", 523 ASSERT_TRUE(RunExtensionSubtest("automation/tests/generated",
524 "generated_trees.html")) << message_; 524 "generated_trees.html")) << message_;
525 } 525 }
526 526
527 } // namespace extensions 527 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | ui/accessibility/ax_generated_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698