OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/spellchecker/spellcheck_action.h" | 10 #include "chrome/browser/spellchecker/spellcheck_action.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 TEST(SpellcheckActionTest, FinalActionsTest) { | 13 TEST(SpellcheckActionTest, FinalActionsTest) { |
14 static const SpellcheckAction::SpellcheckActionType kFinalActions[] = { | 14 static const SpellcheckAction::SpellcheckActionType kFinalActions[] = { |
15 SpellcheckAction::TYPE_ADD_TO_DICT, | 15 SpellcheckAction::TYPE_ADD_TO_DICT, |
16 SpellcheckAction::TYPE_IGNORE, | 16 SpellcheckAction::TYPE_IGNORE, |
17 SpellcheckAction::TYPE_IN_DICTIONARY, | 17 SpellcheckAction::TYPE_IN_DICTIONARY, |
18 SpellcheckAction::TYPE_MANUALLY_CORRECTED, | 18 SpellcheckAction::TYPE_MANUALLY_CORRECTED, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 "{\"actionTargetIndex\": 42, \"actionType\": \"SELECT\"}" }, | 82 "{\"actionTargetIndex\": 42, \"actionType\": \"SELECT\"}" }, |
83 }; | 83 }; |
84 for (size_t i = 0; i < kNumTestCases; ++i) { | 84 for (size_t i = 0; i < kNumTestCases; ++i) { |
85 scoped_ptr<base::DictionaryValue> serialized( | 85 scoped_ptr<base::DictionaryValue> serialized( |
86 kTestCases[i].action.Serialize()); | 86 kTestCases[i].action.Serialize()); |
87 scoped_ptr<base::Value> expected( | 87 scoped_ptr<base::Value> expected( |
88 base::JSONReader::Read(kTestCases[i].expected)); | 88 base::JSONReader::Read(kTestCases[i].expected)); |
89 EXPECT_TRUE(serialized->Equals(expected.get())); | 89 EXPECT_TRUE(serialized->Equals(expected.get())); |
90 } | 90 } |
91 } | 91 } |
OLD | NEW |