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 { ...@@ -72,6 +72,19 @@ class TestClientInitializer : public testing::EmptyTestEventListener {
const char TestSuite::kStrictFailureHandling[] = "strict_failure_handling"; const char TestSuite::kStrictFailureHandling[] = "strict_failure_handling";
TestSuite::TestSuite(int argc, char** argv) { 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) #if defined(OS_WIN)
testing::GTEST_FLAG(catch_exceptions) = false; testing::GTEST_FLAG(catch_exceptions) = false;
#endif #endif
...@@ -86,13 +99,13 @@ TestSuite::TestSuite(int argc, char** argv) { ...@@ -86,13 +99,13 @@ TestSuite::TestSuite(int argc, char** argv) {
#elif defined(TOOLKIT_USES_GTK) #elif defined(TOOLKIT_USES_GTK)
gtk_init_check(&argc, &argv); gtk_init_check(&argc, &argv);
#endif // defined(TOOLKIT_USES_GTK) #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. // Initialize(). See bug 6436.
} }
TestSuite::~TestSuite() {
CommandLine::Reset();
}
// static // static
bool TestSuite::IsMarkedFlaky(const testing::TestInfo& test) { bool TestSuite::IsMarkedFlaky(const testing::TestInfo& test) {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <string> #include <string>
#include "base/at_exit.h" #include "base/at_exit.h"
#include "base/memory/scoped_ptr.h"
namespace testing { namespace testing {
class TestInfo; class TestInfo;
...@@ -59,6 +60,11 @@ class TestSuite { ...@@ -59,6 +60,11 @@ class TestSuite {
static const char kStrictFailureHandling[]; static const char kStrictFailureHandling[];
protected: 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 // By default fatal log messages (e.g. from DCHECKs) result in error dialogs
// which gum up buildbots. Use a minimalistic assert handler which just // which gum up buildbots. Use a minimalistic assert handler which just
// terminates the process. // terminates the process.
...@@ -75,7 +81,11 @@ class TestSuite { ...@@ -75,7 +81,11 @@ class TestSuite {
// Make sure that we setup an AtExitManager so Singleton objects will be // Make sure that we setup an AtExitManager so Singleton objects will be
// destroyed. // 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); DISALLOW_COPY_AND_ASSIGN(TestSuite);
}; };
......
...@@ -263,6 +263,11 @@ void FilterDisabledTests() { ...@@ -263,6 +263,11 @@ void FilterDisabledTests() {
// Flaky on the tryservers, http://crbug.com/103097 // Flaky on the tryservers, http://crbug.com/103097
"URLRequestTestHTTP.MultipleRedirectTest", "URLRequestTestHTTP.MultipleRedirectTest",
"URLRequestTestHTTP.NetworkDelegateRedirectRequest", "URLRequestTestHTTP.NetworkDelegateRedirectRequest",
// These tests are unsupported in CF.
"HTTPSRequestTest.HTTPSPreloadedHSTSTest",
"HTTPSRequestTest.ResumeTest",
"HTTPSRequestTest.SSLSessionCacheShardTest",
}; };
const char* ie9_disabled_tests[] = { const char* ie9_disabled_tests[] = {
...@@ -457,7 +462,7 @@ FakeBrowserProcessImpl* FakeExternalTab::browser_process() const { ...@@ -457,7 +462,7 @@ FakeBrowserProcessImpl* FakeExternalTab::browser_process() const {
} }
CFUrlRequestUnittestRunner::CFUrlRequestUnittestRunner(int argc, char** argv) CFUrlRequestUnittestRunner::CFUrlRequestUnittestRunner(int argc, char** argv)
: NetTestSuite(argc, argv), : NetTestSuite(argc, argv, false),
chrome_frame_html_("/chrome_frame", kChromeFrameHtml), chrome_frame_html_("/chrome_frame", kChromeFrameHtml),
registrar_(chrome_frame_test::GetTestBedType()), registrar_(chrome_frame_test::GetTestBedType()),
test_result_(0) { test_result_(0) {
...@@ -659,21 +664,6 @@ void CFUrlRequestUnittestRunner::PostDestroyThreads() { ...@@ -659,21 +664,6 @@ void CFUrlRequestUnittestRunner::PostDestroyThreads() {
#endif #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) { const char* IEVersionToString(IEVersion version) {
switch (version) { switch (version) {
case IE_6: case IE_6:
...@@ -729,15 +719,13 @@ int main(int argc, char** argv) { ...@@ -729,15 +719,13 @@ int main(int argc, char** argv) {
g_argc = argc; g_argc = argc;
g_argv = argv; g_argv = argv;
// Temporarily disabled, http://crbug.com/105435. if (chrome_frame_test::GetInstalledIEVersion() >= IE_9) {
if (true || chrome_frame_test::GetInstalledIEVersion() >= IE_9) {
// Adding this here as the command line and the logging stuff gets // Adding this here as the command line and the logging stuff gets
// initialized in the NetTestSuite constructor. Did not want to break that. // initialized in the NetTestSuite constructor. Did not want to break that.
base::AtExitManager at_exit_manager; base::AtExitManager at_exit_manager;
CommandLine::Init(argc, argv); CommandLine::Init(argc, argv);
CFUrlRequestUnittestRunner::InitializeLogging(); 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; return 0;
} }
......
...@@ -22,6 +22,11 @@ NetTestSuite::NetTestSuite(int argc, char** argv) ...@@ -22,6 +22,11 @@ NetTestSuite::NetTestSuite(int argc, char** argv)
: TestSuite(argc, argv) { : TestSuite(argc, argv) {
} }
NetTestSuite::NetTestSuite(int argc, char** argv,
bool create_at_exit_manager)
: TestSuite(argc, argv, create_at_exit_manager) {
}
NetTestSuite::~NetTestSuite() {} NetTestSuite::~NetTestSuite() {}
void NetTestSuite::Initialize() { void NetTestSuite::Initialize() {
......
...@@ -27,6 +27,10 @@ class NetTestSuite : public base::TestSuite { ...@@ -27,6 +27,10 @@ class NetTestSuite : public base::TestSuite {
virtual void Shutdown() OVERRIDE; virtual void Shutdown() OVERRIDE;
protected: 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 // Called from within Initialize(), but separate so that derived classes
// can initialize the NetTestSuite instance only and not // 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