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

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

Issue 1151523009: Forward accessibility events to the automation extension process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@step1
Patch Set: Handle case where RenderThread destroys AutomationMessageFilter first 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 | « no previous file | chrome/browser/extensions/api/automation_internal/automation_event_router.h » ('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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 // are equivalent, and then one or both of the trees are reset to a new version. 361 // are equivalent, and then one or both of the trees are reset to a new version.
362 class FakeAutomationInternalEnableTabFunction 362 class FakeAutomationInternalEnableTabFunction
363 : public UIThreadExtensionFunction { 363 : public UIThreadExtensionFunction {
364 public: 364 public:
365 FakeAutomationInternalEnableTabFunction() {} 365 FakeAutomationInternalEnableTabFunction() {}
366 366
367 ExtensionFunction::ResponseAction Run() override { 367 ExtensionFunction::ResponseAction Run() override {
368 using api::automation_internal::EnableTab::Params; 368 using api::automation_internal::EnableTab::Params;
369 scoped_ptr<Params> params(Params::Create(*args_)); 369 scoped_ptr<Params> params(Params::Create(*args_));
370 EXTENSION_FUNCTION_VALIDATE(params.get()); 370 EXTENSION_FUNCTION_VALIDATE(params.get());
371 if (!params->tab_id.get()) 371 if (!params->args.tab_id.get())
372 return RespondNow(Error("tab_id not specified")); 372 return RespondNow(Error("tab_id not specified"));
373 int tab_id = *params->tab_id; 373 int tab_id = *params->args.tab_id;
374 if (tab_id == 0) { 374 if (tab_id == 0) {
375 // tab 0 <--> tree0 375 // tab 0 <--> tree0
376 base::MessageLoop::current()->PostTask( 376 base::MessageLoop::current()->PostTask(
377 FROM_HERE, 377 FROM_HERE,
378 base::Bind(&TreeSerializationState::InitializeTree0, 378 base::Bind(&TreeSerializationState::InitializeTree0,
379 base::Unretained(&state), 379 base::Unretained(&state),
380 base::Unretained(browser_context()))); 380 base::Unretained(browser_context())));
381 // TODO(aboxhall): Need to rewrite this test in terms of tree ids. 381 // TODO(aboxhall): Need to rewrite this test in terms of tree ids.
382 return RespondNow(ArgumentList( 382 return RespondNow(ArgumentList(
383 api::automation_internal::EnableTab::Results::Create(0))); 383 api::automation_internal::EnableTab::Results::Create(0)));
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 "automationInternal.enableTab", 532 "automationInternal.enableTab",
533 FakeAutomationInternalEnableTabFunctionFactory)); 533 FakeAutomationInternalEnableTabFunctionFactory));
534 ASSERT_TRUE(extensions::ExtensionFunctionDispatcher::OverrideFunction( 534 ASSERT_TRUE(extensions::ExtensionFunctionDispatcher::OverrideFunction(
535 "automationInternal.performAction", 535 "automationInternal.performAction",
536 FakeAutomationInternalPerformActionFunctionFactory)); 536 FakeAutomationInternalPerformActionFunctionFactory));
537 ASSERT_TRUE(RunExtensionSubtest("automation/tests/generated", 537 ASSERT_TRUE(RunExtensionSubtest("automation/tests/generated",
538 "generated_trees.html")) << message_; 538 "generated_trees.html")) << message_;
539 } 539 }
540 540
541 } // namespace extensions 541 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/automation_internal/automation_event_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698