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

Unified Diff: chrome/browser/password_manager/keyring_proxy/gnome_keyring_loader_unittest.cc

Issue 8509038: Linux: split GNOME Keyring integration into a separate process. Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: merge Created 8 years, 11 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
Index: chrome/browser/password_manager/keyring_proxy/gnome_keyring_loader_unittest.cc
===================================================================
--- chrome/browser/password_manager/keyring_proxy/gnome_keyring_loader_unittest.cc (revision 0)
+++ chrome/browser/password_manager/keyring_proxy/gnome_keyring_loader_unittest.cc (revision 0)
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 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 <string.h>
+
+#include "chrome/browser/password_manager/keyring_proxy/gnome_keyring_loader.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace keyring_proxy {
+
+class TestKeyringLoader : public GnomeKeyringLoader {
+ public:
+ // Promote members to be public for testing.
+ using GnomeKeyringLoader::LoadGnomeKeyring;
+#define GNOME_KEYRING_USE_KEYRING_METHOD(name) \
+ using GnomeKeyringLoader::gnome_keyring_##name;
+ GNOME_KEYRING_FOR_EACH_FUNC(GNOME_KEYRING_USE_KEYRING_METHOD)
+#undef GNOME_KEYRING_USE_KEYRING_METHOD
+};
+
+TEST(GnomeKeyringLoaderTest, LoadsGnomeKeyring) {
+ TestKeyringLoader loader;
+ EXPECT_TRUE(loader.LoadGnomeKeyring());
+ // Since the test is linked directly with libgnomekeyring, we can compare the
+ // results of dynamically loading it against the directly-linked symbols. But
+ // this only works correctly when compiled with -fPIC as otherwise the linked
+ // symbols go through local PLT stubs which makes the addresses not match.
+#if defined(__PIC__)
+#define GNOME_KEYRING_TEST_KEYRING_METHOD(name) \
+ EXPECT_EQ(&::gnome_keyring_##name, loader.gnome_keyring_##name);
+ GNOME_KEYRING_FOR_EACH_FUNC(GNOME_KEYRING_TEST_KEYRING_METHOD)
+#undef GNOME_KEYRING_TEST_KEYRING_METHOD
+#endif
+}
+
+} // namespace keyring_proxy
Property changes on: chrome/browser/password_manager/keyring_proxy/gnome_keyring_loader_unittest.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698