diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-23 23:39:35 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-23 23:39:35 +0000 |
commit | 37ac95b451ae3cdddf327b9bfc3ba350b149b5ff (patch) | |
tree | e4f65b78b410d48cb7ff06c0193fb34980e5334b /chrome/browser/spellchecker/spellcheck_service_unittest.cc | |
parent | b785a42692ee2b57600f8b2df66f785387d3f7c0 (diff) | |
download | chromium_src-37ac95b451ae3cdddf327b9bfc3ba350b149b5ff.zip chromium_src-37ac95b451ae3cdddf327b9bfc3ba350b149b5ff.tar.gz chromium_src-37ac95b451ae3cdddf327b9bfc3ba350b149b5ff.tar.bz2 |
Correctly integrate StoragePartition into TestingProfile.
Until this CL, TestingProfile had 3 distinct URLRequestContexts it would return to the user: one via profile->GetDefaultStoragePartition()->GetRequestContext(), one via profile->GetRequestContext(), and one via profile->GetResourceContext->GetRequestContext(). All of these had different cookie stores. This CL unified them so they all return the one from profile->GetDefaultStoragePartition()->GetRequestContext(). This correctly mimics how production code works.
Doing this had a bunch of implications:
(1) Removes TestingProfile::CreateRequestContext()/ResetRequestContext()
(2) Changes MockRequestContext to share the URLRequestContext with TestingProfile.
(3) TestingProfile now requires all BrowserThreads.
Point (3) effectively adds TestBrowserThreadBundle into a bunch more spots. Because of that, we also have the following changes:
(a) AshTestBase now has a TestBrowserThreadBundle
(b) Removed a bunch of real threads from tests.
(c) TemplateUrlService has reworked synchronization semantics.
(d) Removed MultiThreadTestHelper.
(e) Added TestingIOThread class + testing API in IOThread to mock out various IO thread tasks which enervated with the new TestBrowserThreadBundle.
TBR=bauerb,brettw,isherman,joth,jyasskin,mattm,mmenke,mnissler,pkasting,rkc,rlp,satorux,tim,xians,joth
BUG=159193
Review URL: https://chromiumcodereview.appspot.com/17127002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213272 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/spellchecker/spellcheck_service_unittest.cc')
-rw-r--r-- | chrome/browser/spellchecker/spellcheck_service_unittest.cc | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/chrome/browser/spellchecker/spellcheck_service_unittest.cc b/chrome/browser/spellchecker/spellcheck_service_unittest.cc index 1f68810..c481af2 100644 --- a/chrome/browser/spellchecker/spellcheck_service_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_service_unittest.cc @@ -11,11 +11,10 @@ #include "chrome/browser/spellchecker/spellcheck_service.h" #include "chrome/common/spellcheck_common.h" #include "chrome/test/base/testing_profile.h" -#include "content/public/test/test_browser_thread.h" +#include "content/public/test/test_browser_thread_bundle.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using content::BrowserThread; using chrome::spellcheck_common::WordList; static BrowserContextKeyedService* BuildSpellcheckService( @@ -25,27 +24,15 @@ static BrowserContextKeyedService* BuildSpellcheckService( class SpellcheckServiceTest : public testing::Test { protected: - SpellcheckServiceTest() - : ui_thread_(BrowserThread::UI, &message_loop_), - file_thread_(BrowserThread::FILE, &message_loop_), - profile_(new TestingProfile()) { - } - virtual void SetUp() OVERRIDE { // Use SetTestingFactoryAndUse to force creation and initialization. SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse( - profile_.get(), &BuildSpellcheckService); + &profile_, &BuildSpellcheckService); } - virtual void TearDown() OVERRIDE { - base::MessageLoop::current()->RunUntilIdle(); - } - - base::MessageLoop message_loop_; - content::TestBrowserThread ui_thread_; - content::TestBrowserThread file_thread_; - - scoped_ptr<TestingProfile> profile_; + private: + content::TestBrowserThreadBundle thread_bundle_; + TestingProfile profile_; }; TEST_F(SpellcheckServiceTest, GetSpellCheckLanguages1) { |