From 46ad7357844bdc3ed4a7fd40d73ad37b56d8c07d Mon Sep 17 00:00:00 2001 From: "derat@chromium.org" Date: Sat, 1 Aug 2009 01:35:45 +0000 Subject: Linux: Fix Valgrind error in VisitedLinkEventsTest.Coalescense. I introduced the error in r22193; it shows up when there's no X server to connect to. I get a "GLib-GObject-CRITICAL **: g_object_get: assertion `G_IS_OBJECT (object)' failed" message with this change, but I'm not sure if it's from my code or if it was already there, and the tests still pass. TEST=ran VisitedLinkEventsTest.Coalescense under Valgrind with DISPLAY=:6 Review URL: http://codereview.chromium.org/159753 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22240 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/browser_window_gtk.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'chrome/browser') diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index e4f7155..ccfc556 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -1194,8 +1194,12 @@ GtkWindow* BrowserWindowGtk::GetBrowserWindowForXID(XID xid) { // static void BrowserWindowGtk::RegisterUserPrefs(PrefService* prefs) { bool custom_frame_default = false; - if (!prefs->HasPrefPath(prefs::kUseCustomChromeFrame)) + // Avoid checking the window manager if we're not connected to an X server (as + // is the case in Valgrind tests). + if (x11_util::XDisplayExists() && + !prefs->HasPrefPath(prefs::kUseCustomChromeFrame)) { custom_frame_default = GetCustomFramePrefDefault(); + } prefs->RegisterBooleanPref( prefs::kUseCustomChromeFrame, custom_frame_default); } -- cgit v1.1