summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-22 19:58:20 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-22 19:58:20 +0000
commit27dfa12aab657fb986e7dd39c3c2d29fe392c2db (patch)
treea464ddd5e4e9fcaaaa1721bea8f89d121eb005de /chrome_frame/test
parent74f7446348778a347443f23b010dca20929a4ed0 (diff)
downloadchromium_src-27dfa12aab657fb986e7dd39c3c2d29fe392c2db.zip
chromium_src-27dfa12aab657fb986e7dd39c3c2d29fe392c2db.tar.gz
chromium_src-27dfa12aab657fb986e7dd39c3c2d29fe392c2db.tar.bz2
Somewhat useful hack to have the chrome frame integration test run in server mode (via a "--server" command line).
This allows the test executable to just start the local server and wait which can be useful for debugging failing tests. Review URL: http://codereview.chromium.org/307042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r--chrome_frame/test/run_all_unittests.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome_frame/test/run_all_unittests.cc b/chrome_frame/test/run_all_unittests.cc
index a03ba76..6c2abe9 100644
--- a/chrome_frame/test/run_all_unittests.cc
+++ b/chrome_frame/test/run_all_unittests.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <atlbase.h>
+#include <iostream>
#include "base/at_exit.h"
#include "base/platform_thread.h"
@@ -11,6 +12,7 @@
#include "base/command_line.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome_frame/test/http_server.h"
#include "chrome_frame/test_utils.h"
// To enable ATL-based code to run in this module
@@ -22,12 +24,35 @@ ChromeFrameUnittestsModule _AtlModule;
const wchar_t kNoRegistrationSwitch[] = L"no-registration";
+// Causes the test executable to just run the web server and quit when the
+// server is killed. Useful for debugging tests.
+const wchar_t kRunAsServer[] = L"server";
+
int main(int argc, char **argv) {
base::EnableTerminationOnHeapCorruption();
PlatformThread::SetName("ChromeFrame tests");
TestSuite test_suite(argc, argv);
+ if (CommandLine::ForCurrentProcess()->HasSwitch(kRunAsServer)) {
+ ChromeFrameHTTPServer server;
+ server.SetUp();
+ GURL server_url(server.server()->TestServerPage(""));
+ std::cout << std::endl
+ << "Server waiting on " << server_url.spec().c_str()
+ << std::endl << std::endl
+ << "Test output will be written to "
+ << server.server()->GetDataDirectory().value().c_str() << "\\dump"
+ << std::endl << std::endl
+ << "Hit Ctrl-C or navigate to "
+ << server_url.spec().c_str() << "kill to shut down the server."
+ << std::endl;
+ server.WaitToFinish(INFINITE);
+ server.TearDown();
+ std::cout << "Server stopped.";
+ return 0;
+ }
+
// If mini_installer is used to register CF, we use the switch
// --no-registration to avoid repetitive registration.
if (CommandLine::ForCurrentProcess()->HasSwitch(kNoRegistrationSwitch)) {