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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/ScrollStateTest.cpp

Issue 2970833002: Be explicit about namespace testing to not mix it with blink::testing (Closed)
Patch Set: Created 3 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/page/scrolling/ScrollState.h" 5 #include "core/page/scrolling/ScrollState.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "platform/wtf/PtrUtil.h" 10 #include "platform/wtf/PtrUtil.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 namespace { 15 namespace {
16 16
17 ScrollState* CreateScrollState(double delta_x, 17 ScrollState* CreateScrollState(double delta_x,
18 double delta_y, 18 double delta_y,
19 bool beginning, 19 bool beginning,
20 bool ending) { 20 bool ending) {
21 std::unique_ptr<ScrollStateData> scroll_state_data = 21 std::unique_ptr<ScrollStateData> scroll_state_data =
22 WTF::MakeUnique<ScrollStateData>(); 22 WTF::MakeUnique<ScrollStateData>();
23 scroll_state_data->delta_x = delta_x; 23 scroll_state_data->delta_x = delta_x;
24 scroll_state_data->delta_y = delta_y; 24 scroll_state_data->delta_y = delta_y;
25 scroll_state_data->is_beginning = beginning; 25 scroll_state_data->is_beginning = beginning;
26 scroll_state_data->is_ending = ending; 26 scroll_state_data->is_ending = ending;
27 return ScrollState::Create(std::move(scroll_state_data)); 27 return ScrollState::Create(std::move(scroll_state_data));
28 } 28 }
29 29
30 class ScrollStateTest : public testing::Test {}; 30 class ScrollStateTest : public ::testing::Test {};
31 31
32 TEST_F(ScrollStateTest, ConsumeDeltaNative) { 32 TEST_F(ScrollStateTest, ConsumeDeltaNative) {
33 const float kDeltaX = 12.3; 33 const float kDeltaX = 12.3;
34 const float kDeltaY = 3.9; 34 const float kDeltaY = 3.9;
35 35
36 const float kDeltaXToConsume = 1.2; 36 const float kDeltaXToConsume = 1.2;
37 const float kDeltaYToConsume = 2.3; 37 const float kDeltaYToConsume = 2.3;
38 38
39 ScrollState* scroll_state = CreateScrollState(kDeltaX, kDeltaY, false, false); 39 ScrollState* scroll_state = CreateScrollState(kDeltaX, kDeltaY, false, false);
40 EXPECT_FLOAT_EQ(kDeltaX, scroll_state->deltaX()); 40 EXPECT_FLOAT_EQ(kDeltaX, scroll_state->deltaX());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 ScrollState* scroll_state = CreateScrollState(0, 0, false, false); 79 ScrollState* scroll_state = CreateScrollState(0, 0, false, false);
80 ScrollState* scroll_state_end = CreateScrollState(0, 0, false, true); 80 ScrollState* scroll_state_end = CreateScrollState(0, 0, false, true);
81 EXPECT_FALSE(scroll_state_begin->FullyConsumed()); 81 EXPECT_FALSE(scroll_state_begin->FullyConsumed());
82 EXPECT_TRUE(scroll_state->FullyConsumed()); 82 EXPECT_TRUE(scroll_state->FullyConsumed());
83 EXPECT_FALSE(scroll_state_end->FullyConsumed()); 83 EXPECT_FALSE(scroll_state_end->FullyConsumed());
84 } 84 }
85 85
86 } // namespace 86 } // namespace
87 87
88 } // namespace blink 88 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698