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

Unified Diff: webkit/tools/test_shell/test_shell_main_gtk.cc

Issue 2983: gtk test shell (Closed)
Patch Set: rebase Created 12 years, 2 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 | « webkit/tools/test_shell/test_shell_gtk.cc ('k') | webkit/tools/test_shell/webwidget_host_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_shell_main_gtk.cc
diff --git a/webkit/tools/test_shell/test_shell_main_gtk.cc b/webkit/tools/test_shell/test_shell_main_gtk.cc
new file mode 100644
index 0000000000000000000000000000000000000000..afee3e4f8085341649a49820ccff8ef0b67e7adf
--- /dev/null
+++ b/webkit/tools/test_shell/test_shell_main_gtk.cc
@@ -0,0 +1,65 @@
+// 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 <gtk/gtk.h>
+
+#include "base/at_exit.h"
+#include "base/command_line.h"
+#include "base/file_util.h"
+#include "base/icu_util.h"
+#include "base/path_service.h"
+#include "base/string_util.h"
+#include "webkit/tools/test_shell/test_shell.h"
+#include "webkit/tools/test_shell/test_shell_switches.h"
+
+// TODO(port): This file is intended to match test_shell_main.cc.
+// Remerge this back into test_shell_main once we have enough supporting pieces
+// in place.
+
+int main(int argc, char* argv[]) {
+ // Make Singletons work.
+ base::AtExitManager at_exit_manager;
+
+ gtk_init(&argc, &argv);
+ // Only parse the command line after GTK's had a crack at it.
+ CommandLine::SetArgcArgv(argc, argv);
+
+ CommandLine parsed_command_line;
+
+ icu_util::Initialize();
+
+ bool layout_test_mode =
+ parsed_command_line.HasSwitch(test_shell::kLayoutTests);
+
+ bool interactive = !layout_test_mode;
+ TestShell::InitializeTestShell(interactive);
+
+ // Treat the first loose value as the initial URL to open.
+ std::wstring uri;
+
+ // Default to a homepage if we're interactive.
+ if (interactive) {
+ PathService::Get(base::DIR_SOURCE_ROOT, &uri);
+ file_util::AppendToPath(&uri, L"webkit");
+ file_util::AppendToPath(&uri, L"data");
+ file_util::AppendToPath(&uri, L"test_shell");
+ file_util::AppendToPath(&uri, L"index.html");
+ }
+
+ if (parsed_command_line.GetLooseValueCount() > 0) {
+ CommandLine::LooseValueIterator iter =
+ parsed_command_line.GetLooseValuesBegin();
+ uri = *iter;
+ }
+
+ TestShell* shell;
+ if (TestShell::CreateNewWindow(uri, &shell)) {
+ // TODO(port): the rest of this. :)
+ }
+
+ // TODO(port): use MessageLoop instead.
+ gtk_main();
+
+ return 0;
+}
« no previous file with comments | « webkit/tools/test_shell/test_shell_gtk.cc ('k') | webkit/tools/test_shell/webwidget_host_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698