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

Side by Side Diff: chrome/browser/extensions/api/dns/dns_apitest.cc

Issue 366813007: Removed InProcessBrowserTest::CleanUpOnMainThread() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed superfluous override. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "extensions/browser/api/dns/host_resolver_wrapper.h" 7 #include "extensions/browser/api/dns/host_resolver_wrapper.h"
8 #include "extensions/browser/api/dns/mock_host_resolver_creator.h" 8 #include "extensions/browser/api/dns/mock_host_resolver_creator.h"
9 #include "net/dns/mock_host_resolver.h" 9 #include "net/dns/mock_host_resolver.h"
10 10
11 class DnsApiTest : public ExtensionApiTest { 11 class DnsApiTest : public ExtensionApiTest {
12 public: 12 public:
13 DnsApiTest() : resolver_creator_(new extensions::MockHostResolverCreator()) {} 13 DnsApiTest() : resolver_creator_(new extensions::MockHostResolverCreator()) {}
14 14
15 private: 15 private:
16 virtual void SetUpOnMainThread() OVERRIDE { 16 virtual void SetUpOnMainThread() OVERRIDE {
17 ExtensionApiTest::SetUpOnMainThread(); 17 ExtensionApiTest::SetUpOnMainThread();
18 extensions::HostResolverWrapper::GetInstance()->SetHostResolverForTesting( 18 extensions::HostResolverWrapper::GetInstance()->SetHostResolverForTesting(
19 resolver_creator_->CreateMockHostResolver()); 19 resolver_creator_->CreateMockHostResolver());
20 } 20 }
21 21
22 virtual void CleanUpOnMainThread() OVERRIDE { 22 virtual void TearDownOnMainThread() OVERRIDE {
23 extensions::HostResolverWrapper::GetInstance()-> 23 extensions::HostResolverWrapper::GetInstance()->
24 SetHostResolverForTesting(NULL); 24 SetHostResolverForTesting(NULL);
25 resolver_creator_->DeleteMockHostResolver(); 25 resolver_creator_->DeleteMockHostResolver();
26 ExtensionApiTest::CleanUpOnMainThread(); 26 ExtensionApiTest::TearDownOnMainThread();
27 } 27 }
28 28
29 // The MockHostResolver asserts that it's used on the same thread on which 29 // The MockHostResolver asserts that it's used on the same thread on which
30 // it's created, which is actually a stronger rule than its real counterpart. 30 // it's created, which is actually a stronger rule than its real counterpart.
31 // But that's fine; it's good practice. 31 // But that's fine; it's good practice.
32 scoped_refptr<extensions::MockHostResolverCreator> resolver_creator_; 32 scoped_refptr<extensions::MockHostResolverCreator> resolver_creator_;
33 }; 33 };
34 34
35 IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsExtension) { 35 IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsExtension) {
36 ASSERT_TRUE(RunExtensionTest("dns/api")) << message_; 36 ASSERT_TRUE(RunExtensionTest("dns/api")) << message_;
37 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698