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

Unified Diff: chrome/renderer/spellchecker/spellcheck_provider_test.cc

Issue 2159283003: [WIP][DO NOT LAND] Componentize spellcheck Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: chrome/renderer/spellchecker/spellcheck_provider_test.cc
diff --git a/chrome/renderer/spellchecker/spellcheck_provider_test.cc b/chrome/renderer/spellchecker/spellcheck_provider_test.cc
deleted file mode 100644
index efb175f94dfee0d97fab2389b8862a6570ff9d6b..0000000000000000000000000000000000000000
--- a/chrome/renderer/spellchecker/spellcheck_provider_test.cc
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) 2012 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 "chrome/renderer/spellchecker/spellcheck_provider_test.h"
-
-#include "base/stl_util.h"
-#include "chrome/common/spellcheck_marker.h"
-#include "chrome/common/spellcheck_messages.h"
-#include "chrome/renderer/spellchecker/spellcheck.h"
-#include "ipc/ipc_message_macros.h"
-
-class MockSpellcheck: public SpellCheck {
-};
-
-FakeTextCheckingCompletion::FakeTextCheckingCompletion()
-: completion_count_(0),
- cancellation_count_(0) {
-}
-
-FakeTextCheckingCompletion::~FakeTextCheckingCompletion() {}
-
-void FakeTextCheckingCompletion::didFinishCheckingText(
- const blink::WebVector<blink::WebTextCheckingResult>& results) {
- ++completion_count_;
-}
-
-void FakeTextCheckingCompletion::didCancelCheckingText() {
- ++completion_count_;
- ++cancellation_count_;
-}
-
-TestingSpellCheckProvider::TestingSpellCheckProvider()
- : SpellCheckProvider(NULL, new MockSpellcheck),
- spelling_service_call_count_(0) {
-}
-
-TestingSpellCheckProvider::TestingSpellCheckProvider(
- SpellCheck* spellcheck)
- : SpellCheckProvider(nullptr, spellcheck),
- spelling_service_call_count_(0) {
-}
-
-TestingSpellCheckProvider::~TestingSpellCheckProvider() {
- delete spellcheck_;
-}
-
-bool TestingSpellCheckProvider::Send(IPC::Message* message) {
-#if !defined(USE_BROWSER_SPELLCHECKER)
- // Call our mock message handlers.
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(TestingSpellCheckProvider, *message)
- IPC_MESSAGE_HANDLER(SpellCheckHostMsg_CallSpellingService,
- OnCallSpellingService)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
-
- if (handled) {
- delete message;
- return true;
- }
-#endif
-
- messages_.push_back(message);
- return true;
-}
-
-void TestingSpellCheckProvider::OnCallSpellingService(int route_id,
- int identifier,
- const base::string16& text,
- const std::vector<SpellCheckMarker>& markers) {
-#if defined (USE_BROWSER_SPELLCHECKER)
- NOTREACHED();
-#else
- ++spelling_service_call_count_;
- blink::WebTextCheckingCompletion* completion =
- text_check_completions_.Lookup(identifier);
- if (!completion) {
- ResetResult();
- return;
- }
- text_.assign(text);
- text_check_completions_.Remove(identifier);
- std::vector<blink::WebTextCheckingResult> results;
- results.push_back(blink::WebTextCheckingResult(
- blink::WebTextDecorationTypeSpelling,
- 0, 5, blink::WebString("hello")));
- completion->didFinishCheckingText(results);
- last_request_ = text;
- last_results_ = results;
-#endif
-}
-
-void TestingSpellCheckProvider::ResetResult() {
- text_.clear();
-}
-
-SpellCheckProviderTest::SpellCheckProviderTest() {}
-SpellCheckProviderTest::~SpellCheckProviderTest() {}
-
-
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider_test.h ('k') | chrome/renderer/spellchecker/spellcheck_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698