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

Unified Diff: chrome/browser/spellchecker/spellcheck_service_browsertest.cc

Issue 1156473007: Enables the user to select multiple languages for spellchecking (UI) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved spellcheck_service_browsertest to a unittest, cleaned code, replied to comments, stopped Mac … Created 5 years, 6 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/browser/spellchecker/spellcheck_service_browsertest.cc
diff --git a/chrome/browser/spellchecker/spellcheck_service_browsertest.cc b/chrome/browser/spellchecker/spellcheck_service_browsertest.cc
index 7c6eed772fc9386dc9219534dee1912c70344bdc..39480a0127ac45f543347156e87e149c8d8c5c30 100644
--- a/chrome/browser/spellchecker/spellcheck_service_browsertest.cc
+++ b/chrome/browser/spellchecker/spellcheck_service_browsertest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/spellchecker/spellcheck_service.h"
+
#include "base/path_service.h"
#include "base/synchronization/waitable_event.h"
#include "chrome/browser/profiles/profile.h"
@@ -12,7 +14,6 @@
#include "chrome/common/spellcheck_common.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/test/test_utils.h"
-#include "url/gurl.h"
using content::BrowserContext;
@@ -34,11 +35,17 @@ const uint8 kCorruptedBDICT[] = {
} // namespace
-class SpellcheckServiceBrowserTest : public InProcessBrowserTest {
+class SpellcheckServiceBrowserTest : public InProcessBrowserTest{
public:
- Profile* GetProfile() {
- return browser()->profile();
+ SpellcheckServiceBrowserTest() {}
+ ~SpellcheckServiceBrowserTest() override {}
+
+ BrowserContext* GetContext() {
+ return static_cast<BrowserContext*>(browser()->profile());
}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SpellcheckServiceBrowserTest);
};
// Tests that we can delete a corrupted BDICT file used by hunspell. We do not
@@ -50,8 +57,8 @@ IN_PROC_BROWSER_TEST_F(SpellcheckServiceBrowserTest, DeleteCorruptedBDICT) {
base::FilePath bdict_path =
chrome::spellcheck_common::GetVersionedFileName("en-US", dict_dir);
- size_t actual = base::WriteFile(bdict_path,
- reinterpret_cast<const char*>(kCorruptedBDICT),
+ size_t actual = base::WriteFile(
+ bdict_path, reinterpret_cast<const char*>(kCorruptedBDICT),
arraysize(kCorruptedBDICT));
EXPECT_EQ(arraysize(kCorruptedBDICT), actual);
@@ -60,15 +67,14 @@ IN_PROC_BROWSER_TEST_F(SpellcheckServiceBrowserTest, DeleteCorruptedBDICT) {
base::WaitableEvent event(true, false);
SpellcheckService::AttachStatusEvent(&event);
- BrowserContext * context = static_cast<BrowserContext*>(GetProfile());
+ BrowserContext* context = GetContext();
// Ensure that the SpellcheckService object does not already exist. Otherwise
// the next line will not force creation of the SpellcheckService and the
// test will fail.
SpellcheckService* service = static_cast<SpellcheckService*>(
SpellcheckServiceFactory::GetInstance()->GetServiceForBrowserContext(
- context,
- false));
+ context, false));
ASSERT_EQ(NULL, service);
// Getting the spellcheck_service will initialize the SpellcheckService

Powered by Google App Engine
This is Rietveld 408576698