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

Unified Diff: Source/web/tests/TextFinderTest.cpp

Issue 1174283002: Fix unit test style in Source/web/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove static Created 5 years, 6 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 | « Source/web/tests/SpinLockTest.cpp ('k') | Source/web/tests/TopControlsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/TextFinderTest.cpp
diff --git a/Source/web/tests/TextFinderTest.cpp b/Source/web/tests/TextFinderTest.cpp
index be10b97b0315d08321b3007f9812c1dd62e7ec60..dd863774c9d67024269ad69b756d0a4766649755 100644
--- a/Source/web/tests/TextFinderTest.cpp
+++ b/Source/web/tests/TextFinderTest.cpp
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "config.h"
-
#include "web/TextFinder.h"
#include "bindings/core/v8/ExceptionStatePlaceholder.h"
@@ -21,14 +20,13 @@
#include "wtf/OwnPtr.h"
#include <gtest/gtest.h>
-using namespace blink;
using blink::testing::runPendingTasks;
-namespace {
+namespace blink {
class TextFinderTest : public ::testing::Test {
protected:
- virtual void SetUp() override;
+ void SetUp() override;
Document& document() const;
TextFinder& textFinder() const;
@@ -76,7 +74,7 @@ TEST_F(TextFinderTest, FindTextSimple)
WebString searchText(String("FindMe"));
WebFindOptions findOptions; // Default.
bool wrapWithinFrame = true;
- WebRect* selectionRect = 0;
+ WebRect* selectionRect = nullptr;
ASSERT_TRUE(textFinder().find(identifier, searchText, findOptions, wrapWithinFrame, selectionRect));
Range* activeMatch = textFinder().activeMatch();
@@ -144,7 +142,7 @@ TEST_F(TextFinderTest, FindTextNotFound)
WebString searchText(String("Boo"));
WebFindOptions findOptions; // Default.
bool wrapWithinFrame = true;
- WebRect* selectionRect = 0;
+ WebRect* selectionRect = nullptr;
EXPECT_FALSE(textFinder().find(identifier, searchText, findOptions, wrapWithinFrame, selectionRect));
EXPECT_FALSE(textFinder().activeMatch());
@@ -163,7 +161,7 @@ TEST_F(TextFinderTest, FindTextInShadowDOM)
WebString searchText(String("foo"));
WebFindOptions findOptions; // Default.
bool wrapWithinFrame = true;
- WebRect* selectionRect = 0;
+ WebRect* selectionRect = nullptr;
// TextIterator currently returns the matches in the document order, instead of the visual order. It visits
// the shadow roots first, so in this case the matches will be returned in the order of <u> -> <b> -> <i>.
@@ -361,8 +359,8 @@ TEST_F(TextFinderTest, SequentialMatches)
class TextFinderFakeTimerTest : public TextFinderTest {
protected:
- virtual void SetUp() override;
- virtual void TearDown() override;
+ void SetUp() override;
+ void TearDown() override;
// A simple platform that mocks out the clock.
class TimeProxyPlatform : public Platform {
@@ -399,32 +397,32 @@ protected:
}
// From blink::Platform:
- virtual double currentTime() override
+ double currentTime() override
{
return ++m_timeCounter;
}
// These blink::Platform methods must be overriden to make a usable object.
- virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) override
+ void cryptographicallyRandomValues(unsigned char* buffer, size_t length) override
{
ensureFallback().cryptographicallyRandomValues(buffer, length);
}
- virtual const unsigned char* getTraceCategoryEnabledFlag(const char* categoryName) override
+ const unsigned char* getTraceCategoryEnabledFlag(const char* categoryName) override
{
return ensureFallback().getTraceCategoryEnabledFlag(categoryName);
}
// These two methods allow timers to work correctly.
- virtual double monotonicallyIncreasingTime() override
+ double monotonicallyIncreasingTime() override
{
return ensureFallback().monotonicallyIncreasingTime();
}
- virtual WebThread* currentThread() override { return ensureFallback().currentThread(); }
- virtual WebUnitTestSupport* unitTestSupport() override { return ensureFallback().unitTestSupport(); }
- virtual WebString defaultLocale() override { return ensureFallback().defaultLocale(); }
- virtual WebCompositorSupport* compositorSupport() override { return ensureFallback().compositorSupport(); }
+ WebThread* currentThread() override { return ensureFallback().currentThread(); }
+ WebUnitTestSupport* unitTestSupport() override { return ensureFallback().unitTestSupport(); }
+ WebString defaultLocale() override { return ensureFallback().defaultLocale(); }
+ WebCompositorSupport* compositorSupport() override { return ensureFallback().compositorSupport(); }
double m_timeCounter;
Platform* m_fallbackPlatform;
@@ -473,4 +471,4 @@ TEST_F(TextFinderFakeTimerTest, ScopeWithTimeouts)
EXPECT_EQ(4, textFinder().totalMatchCount());
}
-} // namespace
+} // namespace blink
« no previous file with comments | « Source/web/tests/SpinLockTest.cpp ('k') | Source/web/tests/TopControlsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698