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

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc

Issue 14123005: Remove operator function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chromeos/chromeos.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
index 705fa01f36cf456ec6b9c9525fecc8a2fd71ae96..aedcf713f249dcf0cf5d592d27775eec78c71de9 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
@@ -31,6 +31,15 @@ namespace chromeos {
namespace input_method {
namespace {
+bool IsContained(const InputMethodDescriptors& descriptors,
satorux1 2013/04/19 03:54:17 function comment is missing. Besides, IsContained(
Seigo Nonaka 2013/04/20 04:50:31 Done.
+ const InputMethodDescriptor& target) {
+ for (size_t i = 0; i < descriptors.size(); ++i) {
+ if (descriptors[i].id() == target.id())
+ return true;
+ }
+ return false;
+}
+
class InputMethodManagerImplTest : public testing::Test {
public:
InputMethodManagerImplTest()
@@ -244,22 +253,18 @@ TEST_F(InputMethodManagerImplTest, TestGetSupportedInputMethods) {
// correct.
const InputMethodDescriptor* id_to_find =
manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId("mozc");
- EXPECT_NE(methods->end(),
- std::find(methods->begin(), methods->end(), *id_to_find));
id_to_find = manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId(
"mozc-chewing");
+ EXPECT_TRUE(IsContained(*methods.get(), *id_to_find));
id_to_find = manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId(
"xkb:us::eng");
- EXPECT_NE(methods->end(),
- std::find(methods->begin(), methods->end(), *id_to_find));
+ EXPECT_TRUE(IsContained(*methods.get(), *id_to_find));
id_to_find = manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId(
"xkb:us:dvorak:eng");
- EXPECT_NE(methods->end(),
- std::find(methods->begin(), methods->end(), *id_to_find));
+ EXPECT_TRUE(IsContained(*methods.get(), *id_to_find));
id_to_find = manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId(
"xkb:fr::fra");
- EXPECT_NE(methods->end(),
- std::find(methods->begin(), methods->end(), *id_to_find));
+ EXPECT_TRUE(IsContained(*methods.get(), *id_to_find));
}
TEST_F(InputMethodManagerImplTest, TestEnableLayouts) {
@@ -275,8 +280,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayouts) {
const InputMethodDescriptor* id_to_find =
manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId(
"english-m"); // The "English Mystery" IME.
- EXPECT_EQ(methods->end(),
- std::find(methods->begin(), methods->end(), *id_to_find));
+ EXPECT_FALSE(IsContained(*methods.get(), *id_to_find));
}
// For http://crbug.com/19655#c11 - (2)
EXPECT_EQ(0, mock_ibus_daemon_controller_->start_count());
@@ -310,12 +314,10 @@ TEST_F(InputMethodManagerImplTest, TestActiveInputMethods) {
const InputMethodDescriptor* id_to_find =
manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId(
"xkb:us::eng");
- EXPECT_NE(methods->end(),
- std::find(methods->begin(), methods->end(), *id_to_find));
+ EXPECT_TRUE(IsContained(*methods.get(), *id_to_find));
id_to_find = manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId(
"xkb:kr:kr104:kor");
- EXPECT_NE(methods->end(),
- std::find(methods->begin(), methods->end(), *id_to_find));
+ EXPECT_TRUE(IsContained(*methods.get(), *id_to_find));
}
TEST_F(InputMethodManagerImplTest, TestSetInputMethodConfig) {
« no previous file with comments | « no previous file | chromeos/chromeos.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698