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 #ifndef USE_BRLAPI | 5 #ifndef USE_BRLAPI |
6 #error This test requires brlapi. | 6 #error This test requires brlapi. |
7 #endif | 7 #endif |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 | 10 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 private: | 171 private: |
172 scoped_ptr<BrlapiConnection> CreateBrlapiConnection() { | 172 scoped_ptr<BrlapiConnection> CreateBrlapiConnection() { |
173 return scoped_ptr<BrlapiConnection>( | 173 return scoped_ptr<BrlapiConnection>( |
174 new MockBrlapiConnection(&connection_data_)); | 174 new MockBrlapiConnection(&connection_data_)); |
175 } | 175 } |
176 | 176 |
177 StubBrailleController stub_braille_controller_; | 177 StubBrailleController stub_braille_controller_; |
178 }; | 178 }; |
179 | 179 |
180 IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateApiTest, DISABLED_WriteDots) { | 180 IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateApiTest, WriteDots) { |
181 connection_data_.display_size = 11; | 181 connection_data_.display_size = 11; |
182 ASSERT_TRUE(RunComponentExtensionTest("braille_display_private/write_dots")) | 182 ASSERT_TRUE(RunComponentExtensionTest("braille_display_private/write_dots")) |
183 << message_; | 183 << message_; |
184 ASSERT_EQ(3U, connection_data_.written_content.size()); | 184 ASSERT_EQ(3U, connection_data_.written_content.size()); |
185 const std::string expected_content(connection_data_.display_size, '\0'); | 185 const std::string expected_content(connection_data_.display_size, '\0'); |
186 for (size_t i = 0; i < connection_data_.written_content.size(); ++i) { | 186 for (size_t i = 0; i < connection_data_.written_content.size(); ++i) { |
187 ASSERT_EQ(std::string( | 187 ASSERT_EQ(std::string( |
188 connection_data_.display_size, | 188 connection_data_.display_size, |
189 static_cast<char>(i)), | 189 static_cast<char>(i)), |
190 connection_data_.written_content[i]) | 190 connection_data_.written_content[i]) |
191 << "String " << i << " doesn't match"; | 191 << "String " << i << " doesn't match"; |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateApiTest, DISABLED_KeyEvents) { | 195 IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateApiTest, KeyEvents) { |
196 connection_data_.display_size = 11; | 196 connection_data_.display_size = 11; |
197 connection_data_.pending_keys.push_back( | 197 connection_data_.pending_keys.push_back( |
198 BRLAPI_KEY_TYPE_CMD | BRLAPI_KEY_CMD_LNUP); | 198 BRLAPI_KEY_TYPE_CMD | BRLAPI_KEY_CMD_LNUP); |
199 connection_data_.pending_keys.push_back( | 199 connection_data_.pending_keys.push_back( |
200 BRLAPI_KEY_TYPE_CMD | BRLAPI_KEY_CMD_LNDN); | 200 BRLAPI_KEY_TYPE_CMD | BRLAPI_KEY_CMD_LNDN); |
201 ASSERT_TRUE(RunComponentExtensionTest("braille_display_private/key_events")); | 201 ASSERT_TRUE(RunComponentExtensionTest("braille_display_private/key_events")); |
202 } | 202 } |
203 | 203 |
204 IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateApiTest, DisplayStateChanges) { | 204 IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateApiTest, DisplayStateChanges) { |
205 connection_data_.display_size = 11; | 205 connection_data_.display_size = 11; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 DismissLockScreen(tester.get()); | 306 DismissLockScreen(tester.get()); |
307 signin_api.OnKeyEvent(key_event); | 307 signin_api.OnKeyEvent(key_event); |
308 user_api.OnKeyEvent(key_event); | 308 user_api.OnKeyEvent(key_event); |
309 EXPECT_EQ(1, signin_delegate->GetEventCount()); | 309 EXPECT_EQ(1, signin_delegate->GetEventCount()); |
310 EXPECT_EQ(2, user_delegate->GetEventCount()); | 310 EXPECT_EQ(2, user_delegate->GetEventCount()); |
311 } | 311 } |
312 | 312 |
313 } // namespace braille_display_private | 313 } // namespace braille_display_private |
314 } // namespace api | 314 } // namespace api |
315 } // namespace extensions | 315 } // namespace extensions |
OLD | NEW |