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

Unified Diff: webkit/tools/test_shell/mock_spellcheck_unittest.cc

Issue 14304004: Convert a bunch of test_shell_tests to content_browsertests. These are tests that depend on loading… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync 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 | « webkit/plugins/ppapi/ppapi_unittest.cc ('k') | webkit/tools/test_shell/plugin_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/mock_spellcheck_unittest.cc
===================================================================
--- webkit/tools/test_shell/mock_spellcheck_unittest.cc (revision 195684)
+++ webkit/tools/test_shell/mock_spellcheck_unittest.cc (working copy)
@@ -1,80 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/format_macros.h"
-#include "base/string_util.h"
-#include "base/stringprintf.h"
-#include "base/utf_string_conversions.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/tools/test_shell/mock_spellcheck.h"
-
-class MockSpellCheckTest : public testing::Test {
- public:
- MockSpellCheckTest() {
- }
-
- virtual ~MockSpellCheckTest() {
- }
-};
-
-TEST_F(MockSpellCheckTest, SpellCheckStrings) {
- // Test cases.
- // Even though the following test cases are copied from our unit test,
- // SpellCheckTest.SpellCheckStrings_EN_US, we omit some test cases which
- // needs to handle non-ASCII characters correctly since our MockSpellCheck
- // class cannot handle non-ASCII characters. (It just ignores non-ASCII
- // characters.)
- static const struct {
- const wchar_t* input;
- bool expected_result;
- int misspelling_start;
- int misspelling_length;
- } kTestCases[] = {
- {L"", true, 0, 0},
- {L" ", true, 0, 0},
- {L"\xA0", true, 0, 0},
- {L"\x3000", true, 0, 0},
-
- {L"hello", true, 0, 0},
- {L"\x4F60\x597D", true, 0, 0},
- {L"\xC548\xB155\xD558\xC138\xC694", true, 0, 0},
- {L"\x3053\x3093\x306B\x3061\x306F", true, 0, 0},
- {L"\x0930\x093E\x091C\x0927\x093E\x0928", true, 0, 0},
- {L"\xFF28\xFF45\xFF4C\xFF4C\xFF4F", true, 0, 0},
- {L"\x03B3\x03B5\x03B9\x03AC" L" " L"\x03C3\x03BF\x03C5", true, 0, 0},
- {L"\x0437\x0434\x0440\x0430\x0432\x0441"
- L"\x0442\x0432\x0443\x0439\x0442\x0435", true, 0, 0},
-
- {L" " L"hello", true, 0, 0},
- {L"hello" L" ", true, 0, 0},
- {L"hello" L" " L"hello", true, 0, 0},
- {L"hello:hello", true, 0, 0},
-
- {L"ifmmp", false, 0, 5},
- {L"_ifmmp_", false, 1, 5},
-
- {L" " L"ifmmp", false, 1, 5},
- {L"ifmmp" L" ", false, 0, 5},
- {L"ifmmp" L" " L"ifmmp", false, 0, 5},
-
- {L"qwertyuiopasd", false, 0, 13},
- {L"qwertyuiopasdf", false, 0, 14},
- };
-
- MockSpellCheck spellchecker;
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
- SCOPED_TRACE(base::StringPrintf("kTestCases[%" PRIuS "]", i));
-
- std::wstring input(kTestCases[i].input);
- int misspelling_start;
- int misspelling_length;
- bool result = spellchecker.SpellCheckWord(WideToUTF16(input),
- &misspelling_start,
- &misspelling_length);
-
- EXPECT_EQ(kTestCases[i].expected_result, result);
- EXPECT_EQ(kTestCases[i].misspelling_start, misspelling_start);
- EXPECT_EQ(kTestCases[i].misspelling_length, misspelling_length);
- }
-}
« no previous file with comments | « webkit/plugins/ppapi/ppapi_unittest.cc ('k') | webkit/tools/test_shell/plugin_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698