diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 01:09:22 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 01:09:22 +0000 |
commit | 8083cc31cb71654db903703a7ee7c56d7df8f6ae (patch) | |
tree | d65ef7b0d2863fab35387214dd770ffe72366a5b | |
parent | b053e3e31795c5a944b074516786eca4e30893d5 (diff) | |
download | chromium_src-8083cc31cb71654db903703a7ee7c56d7df8f6ae.zip chromium_src-8083cc31cb71654db903703a7ee7c56d7df8f6ae.tar.gz chromium_src-8083cc31cb71654db903703a7ee7c56d7df8f6ae.tar.bz2 |
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
-rw-r--r-- | base/test/test_suite.cc | 21 | ||||
-rw-r--r-- | base/test/test_suite.h | 12 | ||||
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.cc | 28 | ||||
-rw-r--r-- | net/base/net_test_suite.cc | 5 | ||||
-rw-r--r-- | net/base/net_test_suite.h | 4 |
5 files changed, 45 insertions, 25 deletions
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc index 6739a4e..cf04caf 100644 --- a/base/test/test_suite.cc +++ b/base/test/test_suite.cc @@ -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) { diff --git a/base/test/test_suite.h b/base/test/test_suite.h index 2572756..4cf6857c 100644 --- a/base/test/test_suite.h +++ b/base/test/test_suite.h @@ -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); }; diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc index 34a728a..389fbf9 100644 --- a/chrome_frame/test/net/fake_external_tab.cc +++ b/chrome_frame/test/net/fake_external_tab.cc @@ -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; } diff --git a/net/base/net_test_suite.cc b/net/base/net_test_suite.cc index e1081d0..3dc91b7 100644 --- a/net/base/net_test_suite.cc +++ b/net/base/net_test_suite.cc @@ -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() { diff --git a/net/base/net_test_suite.h b/net/base/net_test_suite.h index 3ad03e8..ddd23ba 100644 --- a/net/base/net_test_suite.h +++ b/net/base/net_test_suite.h @@ -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 |