summaryrefslogtreecommitdiff
path: root/src/run-js-test.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2011-04-30 10:27:36 -0400
committerDan Winship <danw@gnome.org>2011-05-16 14:56:27 -0400
commit7921954a3187ae8f4742c2c99d91275361fc436c (patch)
treef56ac8a33ecf592a722379e5459672416fc6a774 /src/run-js-test.c
parent0e42de9149ccb7a5b13e9687b30efacb18d3e75f (diff)
environment: move more init stuff here from main.js
Move some more environment-initializationy stuff from main.js to environment.js, and be more careful about not importing shell JS modules until after the environment has been fully patched. Change gnome-shell-plugin to call Environment.init() before Main.start(); this means that Environment.init() now runs before any shell JS modules (besides environment itself) have been imported. Make run-js-test create a ShellGlobal and use its js_context, so that the shell_global_set_property_mutable() stuff in Environment.init() will work correctly in tests as well. https://bugzilla.gnome.org/show_bug.cgi?id=649203
Diffstat (limited to 'src/run-js-test.c')
-rw-r--r--src/run-js-test.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/run-js-test.c b/src/run-js-test.c
index 27cd4001..41fb37c1 100644
--- a/src/run-js-test.c
+++ b/src/run-js-test.c
@@ -24,15 +24,19 @@
* IN THE SOFTWARE.
*/
-#include <config.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-#include <clutter/x11/clutter-x11.h>
-#include <string.h>
-#include <stdlib.h>
+#include "config.h"
+
#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <clutter/x11/clutter-x11.h>
+#include <gdk/gdkx.h>
#include <gjs/gjs.h>
+#include <gtk/gtk.h>
+
+#include "shell-global.h"
+#include "shell-global-private.h"
static char **include_path = NULL;
static char *command = NULL;
@@ -59,10 +63,10 @@ event_filter (GdkXEvent *xevent,
int
main(int argc, char **argv)
{
- char *command_line;
GOptionContext *context;
ClutterActor *stage;
GError *error = NULL;
+ ShellGlobal *global;
GjsContext *js_context;
char *script;
const char *filename;
@@ -94,12 +98,8 @@ main(int argc, char **argv)
setlocale (LC_ALL, "");
g_type_init ();
- command_line = g_strjoinv (" ", argv);
- g_debug ("Command line: %s", command_line);
- g_free (command_line);
-
- g_debug ("Creating new context to eval console script");
- js_context = gjs_context_new_with_search_path (include_path);
+ global = shell_global_get ();
+ js_context = _shell_global_get_gjs_context (global);
/* prepare command line arguments */
if (!gjs_context_define_string_array (js_context, "ARGV",