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

Unified Diff: content/public/test/browser_test.h

Issue 12209016: Allow macros in parametrized browser tests (IN_PROCESS_BROWSER_TEST_P). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/encrypted_media_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test.h
diff --git a/content/public/test/browser_test.h b/content/public/test/browser_test.h
index 8fe49b639540aa39867c7774bbb0ceb358200e3a..8b2f79908aaa8fec4363d64862fb7b0618ac31aa 100644
--- a/content/public/test/browser_test.h
+++ b/content/public/test/browser_test.h
@@ -14,6 +14,7 @@
#if defined(HAS_OUT_OF_PROC_TEST_RUNNER)
#include "base/compiler_specific.h"
+#include "testing/gtest/include/gtest/gtest.h"
#define IN_PROC_BROWSER_TEST_(test_case_name, test_name, parent_class,\
parent_id)\
@@ -44,7 +45,7 @@ void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread()
IN_PROC_BROWSER_TEST_(test_fixture, test_name, test_fixture,\
::testing::internal::GetTypeId<test_fixture>())
-#define IN_PROC_BROWSER_TEST_P(test_case_name, test_name) \
+#define IN_PROC_BROWSER_TEST_P_(test_case_name, test_name) \
class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
: public test_case_name { \
public: \
@@ -72,6 +73,11 @@ void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread()
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::RunTestOnMainThread()
+// Wrap the real macro with an outer macro to ensure that the parameters are
+// evaluated (e.g., if |test_name| is prefixed with MAYBE_).
+#define IN_PROC_BROWSER_TEST_P(test_case_name, test_name) \
+ IN_PROC_BROWSER_TEST_P_(test_case_name, test_name)
+
#endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER)
#endif // CONTENT_TEST_BROWSER_TEST_H_
« no previous file with comments | « content/browser/media/encrypted_media_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698