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

Side by Side Diff: chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Final feedback addressed Created 3 years, 8 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 | « ash/test/ash_test_helper.cc ('k') | chrome/browser/chromeos/options/DEPS » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h" 5 #include "chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 class SelectToSpeakEventHandlerTest : public ash::test::AshTestBase { 79 class SelectToSpeakEventHandlerTest : public ash::test::AshTestBase {
80 public: 80 public:
81 SelectToSpeakEventHandlerTest() 81 SelectToSpeakEventHandlerTest()
82 : generator_(nullptr), 82 : generator_(nullptr),
83 select_to_speak_event_handler_(new SelectToSpeakEventHandler()) {} 83 select_to_speak_event_handler_(new SelectToSpeakEventHandler()) {}
84 84
85 void SetUp() override { 85 void SetUp() override {
86 ash::test::AshTestBase::SetUp(); 86 ash::test::AshTestBase::SetUp();
87 event_delegate_.reset(new SelectToSpeakAccessibilityEventDelegate()); 87 event_delegate_.reset(new SelectToSpeakAccessibilityEventDelegate());
88 ash_test_helper()->views_delegate()->set_test_accessibility_event_delegate( 88 ash_test_helper()
89 event_delegate_.get()); 89 ->test_views_delegate()
90 ->set_test_accessibility_event_delegate(event_delegate_.get());
90 generator_ = &AshTestBase::GetEventGenerator(); 91 generator_ = &AshTestBase::GetEventGenerator();
91 CurrentContext()->AddPreTargetHandler(select_to_speak_event_handler_.get()); 92 CurrentContext()->AddPreTargetHandler(select_to_speak_event_handler_.get());
92 CurrentContext()->AddPreTargetHandler(&event_capturer_); 93 CurrentContext()->AddPreTargetHandler(&event_capturer_);
93 AutomationManagerAura::GetInstance()->Enable(&profile_); 94 AutomationManagerAura::GetInstance()->Enable(&profile_);
94 } 95 }
95 96
96 void TearDown() override { 97 void TearDown() override {
97 CurrentContext()->RemovePreTargetHandler( 98 CurrentContext()->RemovePreTargetHandler(
98 select_to_speak_event_handler_.get()); 99 select_to_speak_event_handler_.get());
99 CurrentContext()->RemovePreTargetHandler(&event_capturer_); 100 CurrentContext()->RemovePreTargetHandler(&event_capturer_);
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 TEST_F(SelectToSpeakEventHandlerTest, PressingControlZDoesNotStopSpeech) { 306 TEST_F(SelectToSpeakEventHandlerTest, PressingControlZDoesNotStopSpeech) {
306 SpeechMonitor monitor; 307 SpeechMonitor monitor;
307 generator_->PressKey(ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN); 308 generator_->PressKey(ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN);
308 generator_->PressKey(ui::VKEY_Z, ui::EF_CONTROL_DOWN); 309 generator_->PressKey(ui::VKEY_Z, ui::EF_CONTROL_DOWN);
309 generator_->ReleaseKey(ui::VKEY_Z, ui::EF_CONTROL_DOWN); 310 generator_->ReleaseKey(ui::VKEY_Z, ui::EF_CONTROL_DOWN);
310 generator_->ReleaseKey(ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN); 311 generator_->ReleaseKey(ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN);
311 EXPECT_FALSE(monitor.DidStop()); 312 EXPECT_FALSE(monitor.DidStop());
312 } 313 }
313 314
314 } // namespace chromeos 315 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/test/ash_test_helper.cc ('k') | chrome/browser/chromeos/options/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698