| 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
|
|
|