summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-28 14:00:36 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-28 14:00:36 +0000
commit14f79fec5f13a623f837f0b9438556180e5e7896 (patch)
treef86cadba8422d4a453acc22792406ff2b2cb8da8 /chrome_frame
parentf8a7f81d377eb872c2c9760813966920810edfb3 (diff)
downloadchromium_src-14f79fec5f13a623f837f0b9438556180e5e7896.zip
chromium_src-14f79fec5f13a623f837f0b9438556180e5e7896.tar.gz
chromium_src-14f79fec5f13a623f837f0b9438556180e5e7896.tar.bz2
Revert 111695 - Have content/ create and destroy its own threads.
Reason: Problems on official builders. Change embedding API and embedders to allow for this. Push inheritance of base::Thread down to content::BrowserThreadImpl so that content::BrowserThread is just a namespace for API functions. This change temporarily disables chrome_frame_net_tests as agreed by the CF lead, see bug 105435. TBR=ben@chromium.org (IWYU change only) BUG=98716,104578,105435 Review URL: http://codereview.chromium.org/8477004 TBR=joi@chromium.org Review URL: http://codereview.chromium.org/8718012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111698 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_frame.gyp1
-rw-r--r--chrome_frame/test/net/fake_external_tab.cc44
-rw-r--r--chrome_frame/test/net/fake_external_tab.h11
3 files changed, 12 insertions, 44 deletions
diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp
index c14440b..f1eb15f 100644
--- a/chrome_frame/chrome_frame.gyp
+++ b/chrome_frame/chrome_frame.gyp
@@ -380,7 +380,6 @@
'../chrome/chrome.gyp:syncapi_core',
'../chrome/chrome_resources.gyp:chrome_resources',
'../content/content.gyp:content_gpu',
- '../content/content.gyp:test_support_content',
'../net/net.gyp:net',
'../net/net.gyp:net_test_support',
'../skia/skia.gyp:skia',
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc
index 5a7d371..b33ad1e 100644
--- a/chrome_frame/test/net/fake_external_tab.cc
+++ b/chrome_frame/test/net/fake_external_tab.cc
@@ -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 @@ void FakeExternalTab::Initialize() {
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 @@ void FakeExternalTab::Initialize() {
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 @@ void FakeExternalTab::Shutdown() {
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 @@ const char* IEVersionToString(IEVersion version) {
}
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;
}
diff --git a/chrome_frame/test/net/fake_external_tab.h b/chrome_frame/test/net/fake_external_tab.h
index e3eb6b1..756e8f8 100644
--- a/chrome_frame/test/net/fake_external_tab.h
+++ b/chrome_frame/test/net/fake_external_tab.h
@@ -17,7 +17,7 @@
#include "chrome_frame/test/net/test_automation_provider.h"
#include "chrome_frame/test/test_server.h"
#include "chrome_frame/test_utils.h"
-#include "content/test/test_browser_thread.h"
+#include "content/public/browser/browser_thread.h"
#include "net/base/net_test_suite.h"
class ProcessSingleton;
@@ -32,7 +32,6 @@ class FakeExternalTab {
virtual ~FakeExternalTab();
virtual void Initialize();
- virtual void InitializePostThreadsCreated();
virtual void Shutdown();
const FilePath& user_data() const {
@@ -106,15 +105,9 @@ class CFUrlRequestUnittestRunner
// on the main thread.
FakeExternalTab fake_chrome_;
scoped_ptr<ProcessSingletonSubclass> pss_subclass_;
- scoped_ptr<content::TestBrowserThread> main_thread_;
+ scoped_ptr<content::DeprecatedBrowserThread> main_thread_;
ScopedChromeFrameRegistrar registrar_;
int test_result_;
-
- // TODO(joi): This should be fixed so that this test executable uses
- // content::BrowserMainParts. As it stands it is a horrible hack.
- scoped_ptr<content::TestBrowserThread> db_thread_;
- scoped_ptr<content::TestBrowserThread> file_thread_;
- scoped_ptr<content::TestBrowserThread> io_thread_;
};
#endif // CHROME_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_