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

Side by Side 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, 10 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <string.h>
6
7 #include "chrome/browser/password_manager/keyring_proxy/gnome_keyring_loader.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace keyring_proxy {
11
12 class TestKeyringLoader : public GnomeKeyringLoader {
13 public:
14 // Promote members to be public for testing.
15 using GnomeKeyringLoader::LoadGnomeKeyring;
16 #define GNOME_KEYRING_USE_KEYRING_METHOD(name) \
17 using GnomeKeyringLoader::gnome_keyring_##name;
18 GNOME_KEYRING_FOR_EACH_FUNC(GNOME_KEYRING_USE_KEYRING_METHOD)
19 #undef GNOME_KEYRING_USE_KEYRING_METHOD
20 };
21
22 TEST(GnomeKeyringLoaderTest, LoadsGnomeKeyring) {
23 TestKeyringLoader loader;
24 EXPECT_TRUE(loader.LoadGnomeKeyring());
25 // Since the test is linked directly with libgnomekeyring, we can compare the
26 // results of dynamically loading it against the directly-linked symbols. But
27 // this only works correctly when compiled with -fPIC as otherwise the linked
28 // symbols go through local PLT stubs which makes the addresses not match.
29 #if defined(__PIC__)
30 #define GNOME_KEYRING_TEST_KEYRING_METHOD(name) \
31 EXPECT_EQ(&::gnome_keyring_##name, loader.gnome_keyring_##name);
32 GNOME_KEYRING_FOR_EACH_FUNC(GNOME_KEYRING_TEST_KEYRING_METHOD)
33 #undef GNOME_KEYRING_TEST_KEYRING_METHOD
34 #endif
35 }
36
37 } // namespace keyring_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698