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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc

Issue 2953033002: Hide handwriting and voice buttons when keyboard is in restricted state (Closed)
Patch Set: Add FEATURE_ALL Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/input_method/input_method_manager_impl.h" 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 ime_controller.current_ime_id_); 1499 ime_controller.current_ime_id_);
1500 1500
1501 // Unlock screen. The original state, pinyin-dv, is restored. 1501 // Unlock screen. The original state, pinyin-dv, is restored.
1502 manager_->SetState(saved_ime_state); 1502 manager_->SetState(saved_ime_state);
1503 manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN); 1503 manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
1504 ime_controller_client.FlushMojoForTesting(); 1504 ime_controller_client.FlushMojoForTesting();
1505 ASSERT_EQ(3u, ime_controller.available_imes_.size()); // Dvorak and 2 IMEs. 1505 ASSERT_EQ(3u, ime_controller.available_imes_.size()); // Dvorak and 2 IMEs.
1506 EXPECT_EQ(ImeIdFromEngineId(ids[1]), ime_controller.current_ime_id_); 1506 EXPECT_EQ(ImeIdFromEngineId(ids[1]), ime_controller.current_ime_id_);
1507 } 1507 }
1508 1508
1509 TEST_F(InputMethodManagerImplTest, SetFeaturesDisabled) {
1510 // All features are enabled by default.
1511 EXPECT_TRUE(
1512 manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_ALL));
1513 EXPECT_TRUE(
1514 manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_EMOJI));
1515 EXPECT_TRUE(manager_->GetImeMenuFeatureEnabled(
1516 InputMethodManager::FEATURE_HANDWRITING));
1517 EXPECT_TRUE(
1518 manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_VOICE));
1519
1520 // Sets emoji disabled and then enabled.
1521 manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_EMOJI, false);
1522 EXPECT_FALSE(
1523 manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_EMOJI));
1524 manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_EMOJI, true);
1525 EXPECT_TRUE(
1526 manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_EMOJI));
1527
1528 // Sets voice disabled and then enabled.
1529 manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_VOICE, false);
1530 EXPECT_FALSE(
1531 manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_VOICE));
1532 manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_VOICE, true);
1533 EXPECT_TRUE(
1534 manager_->GetImeMenuFeatureEnabled(InputMethodManager::FEATURE_VOICE));
1535
1536 // Sets handwriting disabled and then enabled.
1537 manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_HANDWRITING,
1538 false);
1539 EXPECT_FALSE(manager_->GetImeMenuFeatureEnabled(
1540 InputMethodManager::FEATURE_HANDWRITING));
1541 manager_->SetImeMenuFeatureEnabled(InputMethodManager::FEATURE_HANDWRITING,
1542 true);
1543 EXPECT_TRUE(manager_->GetImeMenuFeatureEnabled(
1544 InputMethodManager::FEATURE_HANDWRITING));
1545 }
1546
1509 } // namespace input_method 1547 } // namespace input_method
1510 } // namespace chromeos 1548 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698