Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10099)

Unified Diff: chrome_frame/test/run_all_unittests.cc

Issue 218019: Initial import of the Chrome Frame codebase. Integration in chrome.gyp coming... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/test/perf/silverlight.cc ('k') | chrome_frame/test/test_server.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/run_all_unittests.cc
===================================================================
--- chrome_frame/test/run_all_unittests.cc (revision 0)
+++ chrome_frame/test/run_all_unittests.cc (revision 0)
@@ -0,0 +1,49 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <atlbase.h>
+
+#include "base/at_exit.h"
+#include "base/platform_thread.h"
+#include "base/process_util.h"
+#include "base/test_suite.h"
+#include "base/command_line.h"
+#include "chrome/common/chrome_paths.h"
+
+#include "chrome_frame/test_utils.h"
+
+// To enable ATL-based code to run in this module
+class ChromeFrameUnittestsModule
+ : public CAtlExeModuleT<ChromeFrameUnittestsModule> {
+};
+
+ChromeFrameUnittestsModule _AtlModule;
+
+const wchar_t kNoRegistrationSwitch[] = L"no-registration";
+
+int main(int argc, char **argv) {
+ base::EnableTerminationOnHeapCorruption();
+ PlatformThread::SetName("ChromeFrame tests");
+
+ TestSuite test_suite(argc, argv);
+
+ // If mini_installer is used to register CF, we use the switch
+ // --no-registration to avoid repetitive registration.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(kNoRegistrationSwitch)) {
+ return test_suite.Run();
+ } else {
+ // Register paths needed by the ScopedChromeFrameRegistrar.
+ chrome::RegisterPathProvider();
+
+ // This will register the chrome frame in the build directory. It currently
+ // leaves that chrome frame registered once the tests are done. It must be
+ // constructed AFTER the TestSuite is created since TestSuites create THE
+ // AtExitManager.
+ // TODO(robertshield): Make these tests restore the original registration
+ // once done.
+ ScopedChromeFrameRegistrar registrar;
+
+ return test_suite.Run();
+ }
+}
« no previous file with comments | « chrome_frame/test/perf/silverlight.cc ('k') | chrome_frame/test/test_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698