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