summaryrefslogtreecommitdiffstats
path: root/gfx/test_suite.h
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-14 19:06:30 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-14 19:06:30 +0000
commit98af9aca7168f061bfaae5cd4f4eb3f7de4e70e7 (patch)
treeb2a1eafeb6863d2ca93615034b7dab005fd2e72b /gfx/test_suite.h
parentc70d067f569f4d927e7be8f221f856812af396d7 (diff)
downloadchromium_src-98af9aca7168f061bfaae5cd4f4eb3f7de4e70e7.zip
chromium_src-98af9aca7168f061bfaae5cd4f4eb3f7de4e70e7.tar.gz
chromium_src-98af9aca7168f061bfaae5cd4f4eb3f7de4e70e7.tar.bz2
Create a path provider for gfx, allowing the removal of the temporary app dependency.
TBR=darin BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41552 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx/test_suite.h')
-rw-r--r--gfx/test_suite.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/gfx/test_suite.h b/gfx/test_suite.h
new file mode 100644
index 0000000..3f60d21
--- /dev/null
+++ b/gfx/test_suite.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2010 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.
+
+#ifndef GFX_TEST_SUITE_H_
+#define GFX_TEST_SUITE_H_
+
+#include "build/build_config.h"
+
+#include <string>
+
+#include "gfx/gfx_paths.h"
+#include "base/path_service.h"
+#if defined(OS_MACOSX)
+#include "base/mac_util.h"
+#endif
+#include "base/scoped_nsautorelease_pool.h"
+#include "base/test/test_suite.h"
+
+class GfxTestSuite : public TestSuite {
+ public:
+ GfxTestSuite(int argc, char** argv) : TestSuite(argc, argv) {
+ }
+
+ protected:
+
+ virtual void Initialize() {
+ base::ScopedNSAutoreleasePool autorelease_pool;
+
+ TestSuite::Initialize();
+
+ gfx::RegisterPathProvider();
+
+#if defined(OS_MACOSX)
+ // Look in the framework bundle for resources.
+ // TODO(port): make a resource bundle for non-app exes. What's done here
+ // isn't really right because this code needs to depend on chrome_dll
+ // being built. This is inappropriate in app.
+ FilePath path;
+ PathService::Get(base::DIR_EXE, &path);
+#if defined(GOOGLE_CHROME_BUILD)
+ path = path.AppendASCII("Google Chrome Framework.framework");
+#elif defined(CHROMIUM_BUILD)
+ path = path.AppendASCII("Chromium Framework.framework");
+#else
+#error Unknown branding
+#endif
+ mac_util::SetOverrideAppBundlePath(path);
+#endif // OS_MACOSX
+ }
+
+ virtual void Shutdown() {
+#if defined(OS_MACOSX)
+ mac_util::SetOverrideAppBundle(NULL);
+#endif
+ TestSuite::Shutdown();
+ }
+};
+
+#endif // GFX_TEST_SUITE_H_