diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-08 19:07:18 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-08 19:07:18 +0000 |
commit | 9e2af1469f0f11a6d345f48f6aab2d79217f8e95 (patch) | |
tree | 74afbe163cee92da4109f024d042b7e2f9b10f65 | |
parent | 0693f9ac17c272a1ba3d8b95de1375ef9e92bbe1 (diff) | |
download | chromium_src-9e2af1469f0f11a6d345f48f6aab2d79217f8e95.zip chromium_src-9e2af1469f0f11a6d345f48f6aab2d79217f8e95.tar.gz chromium_src-9e2af1469f0f11a6d345f48f6aab2d79217f8e95.tar.bz2 |
Use FRIEND_TEST() instead of guessing the test class name (!)
Review URL: http://codereview.chromium.org/1626
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1857 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/safe_browsing/protocol_manager.h | 7 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/protocol_manager_unittest.cc | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h index c7276c6..3a6bc74 100644 --- a/chrome/browser/safe_browsing/protocol_manager.h +++ b/chrome/browser/safe_browsing/protocol_manager.h @@ -23,6 +23,7 @@ #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/safe_browsing/safe_browsing_util.h" #include "net/url_request/url_request.h" +#include "testing/gtest/include/gtest/gtest_prod.h" class MessageLoop; class Task; @@ -31,9 +32,9 @@ class Timer; class SafeBrowsingProtocolManager : public URLFetcher::Delegate { // Testing friends: - friend class SafeBrowsingProtocolManagerTest_TestBackOffTimes_Test; - friend class SafeBrowsingProtocolManagerTest_TestChunkStrings_Test; - friend class SafeBrowsingProtocolManagerTest_TestGetHashBackOffTimes_Test; + FRIEND_TEST(SafeBrowsingProtocolManagerTest, TestBackOffTimes); + FRIEND_TEST(SafeBrowsingProtocolManagerTest, TestChunkStrings); + FRIEND_TEST(SafeBrowsingProtocolManagerTest, DISABLED_TestGetHashBackOffTimes); public: SafeBrowsingProtocolManager(SafeBrowsingService* sb_service, diff --git a/chrome/browser/safe_browsing/protocol_manager_unittest.cc b/chrome/browser/safe_browsing/protocol_manager_unittest.cc index f8eae65..3a81c91 100644 --- a/chrome/browser/safe_browsing/protocol_manager_unittest.cc +++ b/chrome/browser/safe_browsing/protocol_manager_unittest.cc @@ -8,9 +8,11 @@ #include "testing/gtest/include/gtest/gtest.h" #include "chrome/browser/safe_browsing/protocol_manager.h" +class SafeBrowsingProtocolManagerTest : public testing::Test { +}; // Ensure that we respect section 5 of the SafeBrowsing protocol specification. -TEST(SafeBrowsingProtocolManagerTest, TestBackOffTimes) { +TEST_F(SafeBrowsingProtocolManagerTest, TestBackOffTimes) { SafeBrowsingProtocolManager pm(NULL, NULL, "", ""); pm.next_update_sec_ = 1800; DCHECK(pm.back_off_fuzz_ >= 0.0 && pm.back_off_fuzz_ <= 1.0); @@ -48,7 +50,7 @@ TEST(SafeBrowsingProtocolManagerTest, TestBackOffTimes) { } // Test string combinations with and without MAC. -TEST(SafeBrowsingProtocolManagerTest, TestChunkStrings) { +TEST_F(SafeBrowsingProtocolManagerTest, TestChunkStrings) { SafeBrowsingProtocolManager pm(NULL, NULL, "", ""); // Add and Sub chunks. @@ -81,7 +83,7 @@ TEST(SafeBrowsingProtocolManagerTest, TestChunkStrings) { } // Flakey, see http://code.google.com/p/chromium/issues/detail?id=1880 -TEST(SafeBrowsingProtocolManagerTest, DISABLED_TestGetHashBackOffTimes) { +TEST_F(SafeBrowsingProtocolManagerTest, DISABLED_TestGetHashBackOffTimes) { SafeBrowsingProtocolManager pm(NULL, NULL, "", ""); // No errors or back off time yet. |