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 <stddef.h> |
| 6 |
5 #include <string> | 7 #include <string> |
6 | 8 |
7 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/macros.h" |
8 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
9 #include "base/values.h" | 12 #include "base/values.h" |
10 #include "chrome/browser/spellchecker/spellcheck_action.h" | 13 #include "chrome/browser/spellchecker/spellcheck_action.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
12 | 15 |
13 TEST(SpellcheckActionTest, FinalActionsTest) { | 16 TEST(SpellcheckActionTest, FinalActionsTest) { |
14 static const SpellcheckAction::SpellcheckActionType kFinalActions[] = { | 17 static const SpellcheckAction::SpellcheckActionType kFinalActions[] = { |
15 SpellcheckAction::TYPE_ADD_TO_DICT, | 18 SpellcheckAction::TYPE_ADD_TO_DICT, |
16 SpellcheckAction::TYPE_IGNORE, | 19 SpellcheckAction::TYPE_IGNORE, |
17 SpellcheckAction::TYPE_IN_DICTIONARY, | 20 SpellcheckAction::TYPE_IN_DICTIONARY, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 "{\"actionTargetIndex\": 42, \"actionType\": \"SELECT\"}" }, | 89 "{\"actionTargetIndex\": 42, \"actionType\": \"SELECT\"}" }, |
87 }; | 90 }; |
88 for (size_t i = 0; i < kNumTestCases; ++i) { | 91 for (size_t i = 0; i < kNumTestCases; ++i) { |
89 scoped_ptr<base::DictionaryValue> serialized( | 92 scoped_ptr<base::DictionaryValue> serialized( |
90 kTestCases[i].action.Serialize()); | 93 kTestCases[i].action.Serialize()); |
91 scoped_ptr<base::Value> expected = | 94 scoped_ptr<base::Value> expected = |
92 base::JSONReader::Read(kTestCases[i].expected); | 95 base::JSONReader::Read(kTestCases[i].expected); |
93 EXPECT_TRUE(serialized->Equals(expected.get())); | 96 EXPECT_TRUE(serialized->Equals(expected.get())); |
94 } | 97 } |
95 } | 98 } |
OLD | NEW |