diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-06 21:31:39 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-06 21:31:39 +0000 |
commit | ec04d3f550df0b20f6d9b6fe06b9c6d7050a9d61 (patch) | |
tree | f38e6f0b7e78cc83cb14d2e09a8f3481a4e7c462 /net/url_request | |
parent | afc78d2db8d7a72ccfb36a7f9a94afb2b4241458 (diff) | |
download | chromium_src-ec04d3f550df0b20f6d9b6fe06b9c6d7050a9d61.zip chromium_src-ec04d3f550df0b20f6d9b6fe06b9c6d7050a9d61.tar.gz chromium_src-ec04d3f550df0b20f6d9b6fe06b9c6d7050a9d61.tar.bz2 |
Add TestBrowserThreadBundle into RenderViewHostTestHarness. Kill some unnecessary real threads.
This CL creates a new class, TestBrowserThreadBundle, that creates a TestBrowserThread for the most commonly needed BrowserThreads. It also adds this thread bundle into RenderViewHostTestHarness because most tests that use this harness need these threads in order to run. To support TestBrowserThreadBundle, BrowserThreadImpl's test construction was also modified to understand a NULL message_loop.
Aside from introducing the new class, this CL also removes:
(1) unnecessary constructors in test
(2) DISALLOW_COPY_AND_ASSIGNS in test fixtures*
(3) now redundant TestBrowserThreads from tests
(4) bad access-level changes for SetUp() and TearDown()
(5) using declarations that root off the global scope
(6) uses of MessageLoop's RunUntilIdle() and Quit()
(7) as many real threads as possible
There are also a changes to MediaCaptureDevicesDispatcher and OneClickSigninHelper that allow unittests to cut dependencies on IO thread activity. DesktopNotificationServiceTest (and a couple of others) were also made single threaded because the synchronization logic required for a non-flaky test meant the parallelism only really exercised the extra code in the test that forced the serialization.
* DISALLOW_COPY_AND_ASSIGN does not serve much purpose in GTest fixture types. However, using it removes the compile-provided default constructor which forces the fixture writer to provide an empty default constructor. Since GTest recommends the default constructor as the preferred method to do setup for a test (as opposed to the SetUp() method), it's confusing to have bunch of classes with both SetUp() and a default constructor. It's simpler and uses less code to just remove the DISALLOW_COPY_AND_ASSIGN. An alternative would be to use the default constructor for initialization, but this is not possible because of our test harnesses are inheritance based which means it is impossible for a derived fixture to perform initialization before the harness if we use the GTest preferred default constructor initialization pattern.
TBR=avi,battre,ben,benwells,brettw,dbeam,dimich,joi,joth,mad,marja,markusheintz,noelallen,phajdan,rdsmith,satorux,scherkus,sky,stevenjb,stuartmorgan,timsteele
BUG=159193
Review URL: https://chromiumcodereview.appspot.com/14197014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204603 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request.cc | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc index 4522315..fe41a6c 100644 --- a/net/url_request/url_request.cc +++ b/net/url_request/url_request.cc @@ -228,10 +228,6 @@ URLRequest::URLRequest(const GURL& url, DCHECK(base::MessageLoop::current()) << "The current base::MessageLoop must exist"; - DCHECK(base::MessageLoop::current()->IsType(base::MessageLoop::TYPE_IO)) - << "" - "The current base::MessageLoop must be TYPE_IO"; - CHECK(context); context->url_requests()->insert(this); @@ -268,10 +264,6 @@ URLRequest::URLRequest(const GURL& url, DCHECK(base::MessageLoop::current()) << "The current base::MessageLoop must exist"; - DCHECK(base::MessageLoop::current()->IsType(base::MessageLoop::TYPE_IO)) - << "" - "The current base::MessageLoop must be TYPE_IO"; - CHECK(context); context->url_requests()->insert(this); |