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

Unified Diff: chrome_frame/test/net/fake_external_tab.cc

Issue 8718012: Revert 111695 - Have content/ create and destroy its own threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/test/net/fake_external_tab.h ('k') | content/browser/browser_main_loop.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/net/fake_external_tab.cc
===================================================================
--- chrome_frame/test/net/fake_external_tab.cc (revision 111697)
+++ chrome_frame/test/net/fake_external_tab.cc (working copy)
@@ -23,12 +23,10 @@
#include "base/system_monitor/system_monitor.h"
#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
-#include "base/threading/thread.h"
#include "base/win/scoped_com_initializer.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_handle.h"
#include "chrome/browser/automation/automation_provider_list.h"
-#include "chrome/browser/browser_process_impl.h" // TODO(joi): Remove
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -54,7 +52,6 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_paths.h"
-#include "content/test/test_browser_thread.h" // TODO(joi): Remove
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
@@ -276,6 +273,8 @@
browser_process_->local_state()->RegisterBooleanPref(
prefs::kMetricsReportingEnabled, false);
+ FilePath profile_path(ProfileManager::GetDefaultProfileDir(user_data()));
+
// Initialize the content client which that code uses to talk to Chrome.
content::SetContentClient(&g_chrome_content_client.Get());
@@ -284,12 +283,14 @@
content::GetContentClient()->set_browser(&g_browser_client.Get());
content::GetContentClient()->set_renderer(&g_renderer_client.Get());
-}
-void FakeExternalTab::InitializePostThreadsCreated() {
- FilePath profile_path(ProfileManager::GetDefaultProfileDir(user_data()));
Profile* profile =
g_browser_process->profile_manager()->GetProfile(profile_path);
+
+ // Create the child threads.
+ g_browser_process->db_thread();
+ g_browser_process->file_thread();
+ g_browser_process->io_thread();
}
void FakeExternalTab::Shutdown() {
@@ -300,39 +301,16 @@
ResourceBundle::CleanupSharedInstance();
}
-// TODO(joi): Remove!
-class ChromeFrameFriendOfBrowserProcessImpl {
- public:
- static void CreateIOThreadState() {
- reinterpret_cast<BrowserProcessImpl*>(
- g_browser_process)->CreateIOThreadState();
- }
-};
-
CFUrlRequestUnittestRunner::CFUrlRequestUnittestRunner(int argc, char** argv)
: NetTestSuite(argc, argv),
chrome_frame_html_("/chrome_frame", kChromeFrameHtml),
registrar_(chrome_frame_test::GetTestBedType()),
test_result_(0) {
// Register the main thread by instantiating it, but don't call any methods.
- main_thread_.reset(new content::TestBrowserThread(
+ main_thread_.reset(new content::DeprecatedBrowserThread(
BrowserThread::UI, MessageLoop::current()));
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
fake_chrome_.Initialize();
-
- db_thread_.reset(new content::TestBrowserThread(BrowserThread::DB));
- db_thread_->Start();
-
- file_thread_.reset(new content::TestBrowserThread(BrowserThread::FILE));
- file_thread_->Start();
-
- ChromeFrameFriendOfBrowserProcessImpl::CreateIOThreadState();
-
- io_thread_.reset(new content::TestBrowserThread(BrowserThread::IO));
- io_thread_->StartIOThread();
-
- fake_chrome_.InitializePostThreadsCreated();
-
pss_subclass_.reset(new ProcessSingletonSubclass(this));
EXPECT_TRUE(pss_subclass_->Subclass(fake_chrome_.user_data()));
StartChromeFrameInHostBrowser();
@@ -609,15 +587,13 @@
}
int main(int argc, char** argv) {
- // TODO(joi): Remove the "true" part here and fix the log statement below.
- if (true || chrome_frame_test::GetInstalledIEVersion() >= IE_9) {
+ if (chrome_frame_test::GetInstalledIEVersion() >= IE_9) {
// Adding this here as the command line and the logging stuff gets
// initialized in the NetTestSuite constructor. Did not want to break that.
base::AtExitManager at_exit_manager;
CommandLine::Init(argc, argv);
CFUrlRequestUnittestRunner::InitializeLogging();
- LOG(INFO) << "Temporarily not running any ChromeFrame "
- << "net tests (http://crbug.com/105435)";
+ LOG(INFO) << "Not running ChromeFrame net tests on IE9+";
return 0;
}
« no previous file with comments | « chrome_frame/test/net/fake_external_tab.h ('k') | content/browser/browser_main_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698