Skip to content

Commit

Permalink
Use FRIEND_TEST_ALL_PREFIXES instead of FRIEND_TEST.
Browse files Browse the repository at this point in the history
Also remove a custom FRIEND_TEST_ALL_PREFIXES #define from 6 years ago.

Review URL: https://codereview.chromium.org/1370563002

Cr-Commit-Position: refs/heads/master@{#350719}
  • Loading branch information
leizleiz authored and Commit bot committed Sep 25, 2015
1 parent eb092a7 commit 47175a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
21 changes: 2 additions & 19 deletions base/json/json_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,14 @@
#include "base/base_export.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/json/json_reader.h"
#include "base/strings/string_piece.h"

#if !defined(OS_CHROMEOS)
#include "base/gtest_prod_util.h"
#endif

namespace base {
class Value;
}

#if defined(OS_CHROMEOS)
// Chromium and Chromium OS check out gtest to different places, so this is
// unable to compile on both if gtest_prod.h is included here. Instead, include
// its only contents -- this will need to be updated if the macro ever changes.
#define FRIEND_TEST(test_case_name, test_name)\
friend class test_case_name##_##test_name##_Test

#define FRIEND_TEST_ALL_PREFIXES(test_case_name, test_name) \
FRIEND_TEST(test_case_name, test_name); \
FRIEND_TEST(test_case_name, DISABLED_##test_name); \
FRIEND_TEST(test_case_name, FLAKY_##test_name)
#endif // OS_CHROMEOS
class Value;

namespace base {
namespace internal {

class JSONParserTest;
Expand Down
15 changes: 8 additions & 7 deletions jingle/notifier/base/xmpp_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PreXmppAuth;
class XmlElement;
class XmppClientSettings;
class XmppTaskParentInterface;
} // namespace
} // namespace buzz

namespace jingle_glue {
class TaskPump;
Expand Down Expand Up @@ -80,6 +80,13 @@ class XmppConnection
~XmppConnection() override;

private:
FRIEND_TEST_ALL_PREFIXES(XmppConnectionTest, RaisedError);
FRIEND_TEST_ALL_PREFIXES(XmppConnectionTest, Connect);
FRIEND_TEST_ALL_PREFIXES(XmppConnectionTest, MultipleConnect);
FRIEND_TEST_ALL_PREFIXES(XmppConnectionTest, ConnectThenError);
FRIEND_TEST_ALL_PREFIXES(XmppConnectionTest,
TasksDontRunAfterXmppConnectionDestructor);

void OnStateChange(buzz::XmppEngine::State state);
void OnInputLog(const char* data, int len);
void OnOutputLog(const char* data, int len);
Expand All @@ -91,12 +98,6 @@ class XmppConnection
bool on_connect_called_;
Delegate* delegate_;

FRIEND_TEST(XmppConnectionTest, RaisedError);
FRIEND_TEST(XmppConnectionTest, Connect);
FRIEND_TEST(XmppConnectionTest, MultipleConnect);
FRIEND_TEST(XmppConnectionTest, ConnectThenError);
FRIEND_TEST(XmppConnectionTest, TasksDontRunAfterXmppConnectionDestructor);

DISALLOW_COPY_AND_ASSIGN(XmppConnection);
};

Expand Down

0 comments on commit 47175a7

Please sign in to comment.