OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/test/test_content_client_initializer.h" |
| 6 |
| 7 #include "content/browser/mock_content_browser_client.h" |
| 8 #include "content/browser/notification_service_impl.h" |
| 9 #include "content/public/common/content_client.h" |
| 10 #include "content/test/test_content_client.h" |
| 11 |
| 12 TestContentClientInitializer::TestContentClientInitializer() { |
| 13 notification_service_.reset(new NotificationServiceImpl()); |
| 14 |
| 15 DCHECK(!content::GetContentClient()); |
| 16 content_client_.reset(new TestContentClient); |
| 17 content::SetContentClient(content_client_.get()); |
| 18 |
| 19 content_browser_client_.reset(new content::MockContentBrowserClient()); |
| 20 content_client_->set_browser(content_browser_client_.get()); |
| 21 } |
| 22 |
| 23 TestContentClientInitializer::~TestContentClientInitializer() { |
| 24 notification_service_.reset(); |
| 25 |
| 26 DCHECK_EQ(content_client_.get(), content::GetContentClient()); |
| 27 content::SetContentClient(NULL); |
| 28 content_client_.reset(); |
| 29 |
| 30 content_browser_client_.reset(); |
| 31 } |
OLD | NEW |