Commit 8083cc31 authored by ananta@chromium.org's avatar ananta@chromium.org

Enable ChromeFrame net tests for IE versions 8 and below. Changes include the following:-

1. Get rid of the dummy AtlModule registration in the chrome frame net test suite. This is no longer needed
   as there is an Atlmodule instance instantiated by the content code.

2. The TestSuite and NetTestSuite classes now provide special protected constructors which allow
   test instances to control whether an AtExitManager instance is created for the duration of the
   test. The ChromeFrame net test suite reuses the AtExitManager instance created in BrowserMain.

Fixes bug http://code.google.com/p/chromium/issues/detail?id=105435

BUG=105435
TEST=ChromeFrame net tests should now run on the builders.
Review URL: http://codereview.chromium.org/8907054

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114559 0039d316-1c4b-4281-b951-d872f2087c98
parent b053e3e3
......@@ -72,6 +72,19 @@ class TestClientInitializer : public testing::EmptyTestEventListener {
const char TestSuite::kStrictFailureHandling[] = "strict_failure_handling";
TestSuite::TestSuite(int argc, char** argv) {
PreInitialize(argc, argv, true);
}
TestSuite::TestSuite(int argc, char** argv, bool create_at_exit_manager) {
PreInitialize(argc, argv, create_at_exit_manager);
}
TestSuite::~TestSuite() {
CommandLine::Reset();
}
void TestSuite::PreInitialize(int argc, char** argv,
bool create_at_exit_manager) {
#if defined(OS_WIN)
testing::GTEST_FLAG(catch_exceptions) = false;
#endif
......@@ -86,13 +99,13 @@ TestSuite::TestSuite(int argc, char** argv) {
#elif defined(TOOLKIT_USES_GTK)
gtk_init_check(&argc, &argv);
#endif // defined(TOOLKIT_USES_GTK)
// Don't add additional code to this constructor. Instead add it to
if (create_at_exit_manager)
at_exit_manager_.reset(new base::AtExitManager);
// Don't add additional code to this function. Instead add it to
// Initialize(). See bug 6436.
}
TestSuite::~TestSuite() {
CommandLine::Reset();
}
// static
bool TestSuite::IsMarkedFlaky(const testing::TestInfo& test) {
......
......@@ -13,6 +13,7 @@
#include <string>
#include "base/at_exit.h"
#include "base/memory/scoped_ptr.h"
namespace testing {
class TestInfo;
......@@ -59,6 +60,11 @@ class TestSuite {
static const char kStrictFailureHandling[];
protected:
// This constructor is only accessible to specialized test suite
// implementations which need to control the creation of an AtExitManager
// instance for the duration of the test.
TestSuite(int argc, char** argv, bool create_at_exit_manager);
// By default fatal log messages (e.g. from DCHECKs) result in error dialogs
// which gum up buildbots. Use a minimalistic assert handler which just
// terminates the process.
......@@ -75,7 +81,11 @@ class TestSuite {
// Make sure that we setup an AtExitManager so Singleton objects will be
// destroyed.
base::AtExitManager at_exit_manager_;
scoped_ptr<base::AtExitManager> at_exit_manager_;
private:
// Basic initialization for the test suite happens here.
void PreInitialize(int argc, char** argv, bool create_at_exit_manager);
DISALLOW_COPY_AND_ASSIGN(TestSuite);
};
......
......@@ -263,6 +263,11 @@ void FilterDisabledTests() {
// Flaky on the tryservers, http://crbug.com/103097
"URLRequestTestHTTP.MultipleRedirectTest",
"URLRequestTestHTTP.NetworkDelegateRedirectRequest",
// These tests are unsupported in CF.
"HTTPSRequestTest.HTTPSPreloadedHSTSTest",
"HTTPSRequestTest.ResumeTest",
"HTTPSRequestTest.SSLSessionCacheShardTest",
};
const char* ie9_disabled_tests[] = {
......@@ -457,7 +462,7 @@ FakeBrowserProcessImpl* FakeExternalTab::browser_process() const {
}
CFUrlRequestUnittestRunner::CFUrlRequestUnittestRunner(int argc, char** argv)
: NetTestSuite(argc, argv),
: NetTestSuite(argc, argv, false),
chrome_frame_html_("/chrome_frame", kChromeFrameHtml),
registrar_(chrome_frame_test::GetTestBedType()),
test_result_(0) {
......@@ -659,21 +664,6 @@ void CFUrlRequestUnittestRunner::PostDestroyThreads() {
#endif
}
// We need a module since some of the accessibility code that gets pulled
// in here uses ATL.
class ObligatoryModule: public CAtlExeModuleT<ObligatoryModule> {
public:
static HRESULT InitializeCom() {
return OleInitialize(NULL);
}
static void UninitializeCom() {
OleUninitialize();
}
};
ObligatoryModule g_obligatory_atl_module;
const char* IEVersionToString(IEVersion version) {
switch (version) {
case IE_6:
......@@ -729,15 +719,13 @@ int main(int argc, char** argv) {
g_argc = argc;
g_argv = argv;
// Temporarily disabled, http://crbug.com/105435.
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 ChromeFrame net tests.";
//LOG(INFO) << "Not running ChromeFrame net tests on IE9+";
LOG(INFO) << "Not running ChromeFrame net tests on IE9+";
return 0;
}
......
......@@ -22,6 +22,11 @@ NetTestSuite::NetTestSuite(int argc, char** argv)
: TestSuite(argc, argv) {
}
NetTestSuite::NetTestSuite(int argc, char** argv,
bool create_at_exit_manager)
: TestSuite(argc, argv, create_at_exit_manager) {
}
NetTestSuite::~NetTestSuite() {}
void NetTestSuite::Initialize() {
......
......@@ -27,6 +27,10 @@ class NetTestSuite : public base::TestSuite {
virtual void Shutdown() OVERRIDE;
protected:
// This constructor is only accessible to specialized net test
// implementations which need to control the creation of an AtExitManager
// instance for the duration of the test.
NetTestSuite(int argc, char** argv, bool create_at_exit_manager);
// Called from within Initialize(), but separate so that derived classes
// can initialize the NetTestSuite instance only and not
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment